Skip to content

Instantly share code, notes, and snippets.

@SimplGy
Created February 12, 2016 02:35
Show Gist options
  • Save SimplGy/aa29ff4698c470af25c4 to your computer and use it in GitHub Desktop.
Save SimplGy/aa29ff4698c470af25c4 to your computer and use it in GitHub Desktop.
Sometimes you need to make sure init and deinit happen in the right order on your View Controllers, and you don't stand up two at once.
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
print("init nibName: \(self) \(unsafeAddressOf(self))")
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
print("init coder: \(self) \(unsafeAddressOf(self))")
}
deinit {
print("deinit coder: \(self) \(unsafeAddressOf(self))")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment