Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Common - Portuguese - pt-BR.lproj/Localizable.strings
- // "common.change" = "Mudar";
- // "common.error" = "Erro";
- // "common.delete" = "Exluir";
- // "common.wait" = "Aguarde";
- // Common - English - en.lproj/Localizable.strings
- // "common.change" = "Change";
- // "common.error" = "Error";
- // "common.delete" = "Delete";
- // "common.wait" = "Wait";
- // MARK: - Project Constants
- enum Project {
- // Image Names
- enum Images {
- enum Checkout: String, ImageRepresentable {
- case first = "icon-first-image"
- case second = "icon-second-image"
- }
- }
- // Localizable Strings
- enum Localizable {
- // Common
- enum Common: String, LocalizeRepresentable {
- case change = "common.change"
- case error = "common.error"
- case delete = "common.delete"
- case wait = "common.wait"
- }
- }
- }
- // MARK: - Representable Protocols
- protocol ImageRepresentable: RawRepresentable {
- var image: UIImage? { get }
- }
- protocol LocalizeRepresentable: RawRepresentable {
- var localized: String { get }
- }
- // MARK: - Representable Protocols Extensions
- extension ImageRepresentable where RawValue == String {
- var image: UIImage? {
- return UIImage(named: rawValue)
- }
- }
- extension LocalizeRepresentable where RawValue == String {
- var localized: String {
- return NSLocalizedString(rawValue, comment: "")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement