Created
August 2, 2022 03:21
-
-
Save tgnivekucn/58b48eae9d1fbaf7e83daf08fcf52915 to your computer and use it in GitHub Desktop.
Custom color identifier rule
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
Color identifier naming rule: | |
Regular expression: | |
(color)\.((common)|([A-Za-z])+(Page)){1}(\.([A-Za-z])+)*(\.([A-Za-z])+(Color)s?)$ | |
Example: | |
1. Color category | |
2. UI page name or plist file name | |
3. Subview name(ex: customCell) (p.s. this field might be zero) | |
4. Unique color name (p.s. or unique color array name) | |
Correct example: | |
color.common.backgroundColor | |
color.common.customCell.dataColor | |
color.myPage.titleColor | |
color.myPage.testCell.titleColor | |
color.myPage.testCell.testView.titleColor | |
color.myPage.testCell.dataColors | |
Wrong example: | |
color.myPage | |
color.myPage.dataColor1 | |
color.myPage1.titleColor | |
color.myPage.testCell | |
Note: | |
If you want to check whether the identifiter name matchs the rule or not, you can use below website tool with the regular expression above | |
Regular expression online validator: https://regexr.com/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment