Skip to content

Instantly share code, notes, and snippets.

@esttorhe
Created January 20, 2016 16:26
Show Gist options
  • Save esttorhe/e7f396c30f6b3a77e181 to your computer and use it in GitHub Desktop.
Save esttorhe/e7f396c30f6b3a77e181 to your computer and use it in GitHub Desktop.
protocol MyProtocol {
func setup()
}
extension MyProtocol where Self: UIViewController {
func setup() {
// Do something here
}
}
class MyViewController: MyProtocol {
override func viewDidLoad() {
setup()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment