Last active
December 13, 2019 14:26
-
-
Save andr3a88/fb9d3f78424643bc3dd5debba54f2557 to your computer and use it in GitHub Desktop.
LocalizedView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
protocol LocalizedView { | |
/// Localized type | |
var localizer: Localizer { get } | |
} | |
extension LocalizedView where Self: UIViewController { | |
var localizer: Localizer { | |
let localizableStrings = Settings().configuration?.localizableStrings ?? [:] | |
return Localizer(localizableStrings: localizableStrings) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment