Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Constants #10

Open
clmct opened this issue Jan 17, 2022 · 0 comments
Open

Image Constants #10

clmct opened this issue Jan 17, 2022 · 0 comments

Comments

@clmct
Copy link
Owner

clmct commented Jan 17, 2022

enum ImageNames {
    // MARK: Images
    static let appLogo = "AppLogo"
    static let personPlaceholder = "PersonPlaceholderImage"
    static let match = "MatchImage"
    static let welcomePeople = "WelcomePeopleImage"
    
    // MARK: Icons
    static let streamIcon = "StreamIcon"
    static let peopleIcon = "PeopleIcon"
    static let chatsIcon = "ChatsIcon"
    static let personIcon = "PersonIcon"
    static let crossIcon = "CrossIcon"
    static let heartIcon = "HeartIcon"
    static let cameraIcon = "CameraIcon"
    static let sendIcon = "SendIcon"
    static let editIcon = "EditIcon"
}

За константы названия картинок плюс. Подсвечу два момента.

  1. Лучше выносить UIImage, мы все равно вызываем UIImage. Те будет так

static let appLogo = UIImage(named: "AppLogo")

  1. Для удобной работы с локализацией и ресурсами(картинки) можно использовать R.swift (ссылка) или SwiftGen (ссылка)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant