Last active
February 1, 2017 17:27
-
-
Save Thomvis/9941fec3d6682b1de45c3475c01c98e0 to your computer and use it in GitHub Desktop.
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
protocol HeaderViewProtocol { | |
func setTitle(_ title: String) | |
func asUIView() -> UIView | |
} | |
extension HeaderViewProtocol where Self: UIView { | |
func asUIView() -> UIView { | |
return self | |
} | |
} | |
let header: HeaderViewProtocol! = MyHeaderView() | |
header.setTitle("Hello") | |
header.asUIView().removeFromSuperview() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment