I am trying to present a viewcontroller embedded in a navigation caontroller by tapping a button. Everytime I tap the button the app crashes saying
Could not cast value of type 'UINavigationController' (0x11320f420) to
my code to display the Viewcontroller
@IBAction func skipButtonTapped(_ : UIButton) {
let viewController: CategoryVC = UIStoryboard(name: "CategorySB", bundle: nil).instantiateViewController(withIdentifier: Constants.CATEGORY_VC) as! CategoryVC
self.present(viewController, animated: true, completion: nil)
}
any help thanks
See Question&Answers more detail:os