Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Project.swift
- // Created by Itamar Sousa Silva on 12/07/18.
- //
- import Foundation
- import UIKit
- /*
- Todas as strings estão mapeadas aqui.
- Caso adicione algum texto no projeto verifique se já não existe.
- O app até o momento não será internalizando, mas caso seja, basta mudar o Localizable.strings para o idioma desejado.
- */
- // 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 {
- enum Commom: String, LocalizeRepresentable {
- case email = "commom.email"
- case password = "commom.password"
- }
- enum Buttons: String, LocalizeRepresentable {
- case login = "buttons.login"
- }
- enum Title: String, LocalizeRepresentable {
- case login = "title.login"
- case enterprises = "title.enterprises"
- }
- }
- }
- // 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