This is my StartViewController
with simple @IBAction
:
class StartViewController: UIViewController {
@IBAction func startButtonTapped(sender: UIButton) {
revealViewController().revealToggleAnimated(true) //error
}
}
Along with the commented line there is an error:
fatal error: unexpectedly found nil while unwrapping an Optional value
What am I doing wrong?
Of course StartViewController
is presented from SWRevealViewController
via sw_front
segue.
For some reason revealViewController()
returns nil here. Why?
This is how my storyboard looks like: