Created
August 9, 2020 09:53
-
-
Save cipolleschi/a4ed6132cad34b7ecea8c0980f3e7a1e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class LegalView: UIView { | |
| func setup() { | |
| // add elements to the view | |
| self.setupAccessibilityIdentifiers() | |
| // ... | |
| } | |
| } | |
| extension LegalView { | |
| enum AccessibilityIdentifiers: String { | |
| case legalView = "legal_view" | |
| case tosButton = "legal_view.tos_button" | |
| case privacyButton = "legal_view.privacy_button" | |
| case continueButton = "legal_view.continue_button" | |
| } | |
| func setAcceccibilityIdentifiers() { | |
| self.accessibilityIdentifier = AccessibilityIdentifiers.legalView.rawValue | |
| self.tosButton.accessibilityIdentifier = AccessibilityIdentifiers.tosButton.rawValue | |
| self.privacyButton.accessibilityIdentifier = AccessibilityIdentifiers.privacyButton.rawValue | |
| self.continueButton.accessibilityIdentifier = AccessibilityIdentifiers.continueButton.rawValue | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment