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

Constants should be centralized #15

Open
gunesmert opened this issue Jul 25, 2023 · 0 comments
Open

Constants should be centralized #15

gunesmert opened this issue Jul 25, 2023 · 0 comments

Comments

@gunesmert
Copy link
Collaborator

We should be centralizing the constants that we are using throughout our codebase. My first suggestion for this could be for margins that we are using. For instance, I aim for sth like this:

enum Constants {
    enum Margin {
        static let extraSmall: CGFloat = 4
        static let small: CGFloat = 8
        static let medium: CGFloat = 16
        static let large: CGFloat = 24
        static let extraLarge: CGFloat = 32
    }
}

Here, using an an enum and static properties let use to reach them directly. Also, by using an enum, we are making sure that no one can instantiate Constants.

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