Skip to content

Instantly share code, notes, and snippets.

@soopa
Created May 5, 2015 21:10
Show Gist options
  • Save soopa/b98a6a52c4be42c34a28 to your computer and use it in GitHub Desktop.
Save soopa/b98a6a52c4be42c34a28 to your computer and use it in GitHub Desktop.
// The variable `delegate` property of `UINavigationController` is defined as `unowned`.
//
// Given a case in which that `delegate` must be retained, is this the best pattern for doing so?
class CustomNavigationController: UINavigationController {
override var delegate: UINavigationControllerDelegate? {
didSet {
self.strongDelegate = delegate
}
}
private var strongDelegate: UINavigationControllerDelegate?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment