Depending on the user's action, I need to move the user from one view controller
to another depending on if they complete a task by time or complete a task by pressing a button. Both call the same method completeSession()
I've gone into the storyboard and added a Storyboard ID for each screen that is the same as the view controller class. So for this question, class JournalViewController
has a storyboard ID of JournalViewController
, same with SecondViewController
func completeSession() -> Void {
... some other stuff, unrelated ...
let journalViewController = self.storyboard?.instantiateViewControllerWithIdentifier("JournalViewController") as ViewController
self.presentViewController(journalViewController, animated: true, completion: nil)
}
This isn't working and causing my app to crash with a reason: Storyboard <UIStoryboard> doesn't contain a view controller with identifier JournalViewController
, yet JournalViewController.swift contains:
class JournalViewController: UIViewController, UITextView Delegate {
Any idea how to push from SecondViewController
to JournalViewController
without error?