I'm trying to navigate to another ViewController but it's not connected by segue, so I programmed the nav bar and what I want it's when y push the button named "Start Over" the ViewController that I'm requesting appears, but this errors appears:
"Cannot convert value of type MemeEditorViewController.Type yo expected argument type UIViewController"
So I don't how to deal with. Here's my code, maybe you could help me better.
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title:"Start Over", style: .Plain, target: self, action: "startOver")
}
func startOver(){
if let navigationController = self.navigationController {
navigationController.popToViewController(MemeEditorViewController, animated: true)
}
}
}
Aucun commentaire:
Enregistrer un commentaire