Created
February 1, 2017 13:12
-
-
Save a2/a02890af9bf4553611ed0413cf4fad06 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
| import UIKit | |
| protocol ViewProtocol { | |
| var view: UIView { get } | |
| } | |
| extension ViewProtocol where Self: UIView { | |
| var view: UIView { | |
| return self | |
| } | |
| } | |
| extension ViewProtocol { | |
| var backgroundColor: UIColor? { | |
| get { | |
| return view.backgroundColor | |
| } | |
| set { | |
| view.backgroundColor = newValue | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment