Skip to content

Instantly share code, notes, and snippets.

@soopa
Created May 5, 2015 21:10
// 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