Tworzę niestandardowy kontroler nawigacyjny. Mam coś takiego:Błąd krytyczny: użycie niezatwierdzonego inicjalizatora w niestandardowym kontrolerze nawigacji
public class CustomNavigationController: UINavigationController {
// MARK: - Life Cycle
override init(rootViewController: UIViewController) {
super.init(rootViewController: rootViewController)
delegate = self
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
delegate = self
}
}
chciałem przetestować to na zewnątrz więc stworzyłem CustomNavigationController takiego:
CustomNavigationController(rootViewController: ViewController())
Kiedy uruchomić aplikację uzyskać to:
fatal error: use of unimplemented initializer 'init(nibName:bundle:)' for class 'TestApp.CustomNavigationController'
Nie widzę problemu, czy ktoś może mi pomóc?
co jest 'delegat = self'? po prostu usunięcie, że mógłbym uruchomić twój kod bez problemu – Aladin
To jest UINavigationControllerDelegate. – user1007522