Skip to content

Instantly share code, notes, and snippets.

@rockbruno
Created September 13, 2018 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rockbruno/b548a4f56b3fb88d2c63ef9a9ee5ff99 to your computer and use it in GitHub Desktop.
Save rockbruno/b548a4f56b3fb88d2c63ef9a9ee5ff99 to your computer and use it in GitHub Desktop.
class CustomViewController<CustomView: UIView>: UIViewController {
var customView: CustomView {
return view as! CustomView
}
override func loadView() {
view = CustomView()
}
}
final class MyViewController: CustomViewController<MyView> {
override func loadView() {
super.loadView()
customView.delegate = self
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment