Last active
September 28, 2018 14:18
-
-
Save milanstevanovic/a61020b0641cc9852215f630d18d2347 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
| protocol UITestablePage { | |
| associatedtype UIElementType: UIElement | |
| func makeViewTestable(_ view: UIView, using element: UIElementType) | |
| func makeViewTestable(_ view: UIView, using element: UIElementType, sequence: String) | |
| } | |
| extension UITestablePage { | |
| func makeViewTestable(_ view: UIView, using element: UIElementType) { | |
| view.accessibilityIdentifier = element.accessibilityIdentifier | |
| } | |
| func makeViewTestable(_ view: UIView, using element: UIElementType, sequence: String) { | |
| view.accessibilityIdentifier = element.rawValue(withSequence: sequence) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment