I am using the storyboard references in my project. When I tried to load view controller using self.storyboard it crashes. But When I created a new instance of storyboard and tried to load it works perfectly.
Another thing is without storyboard reference it works perfectly for the first case also.
I am using Xcode 7.3.1.
With self.storyboard. It crashes
guard let registerViewController = self.storyboard?.instantiateViewControllerWithIdentifier(StoryboardIdentifier.Registration) as? RegisterVC else { return }
This is the instance of UIStoryboard. It works.
let mainStoryBoard = UIStoryboard.init(name: "Main", bundle: nil)
guard let registerViewController = mainStoryBoard.instantiateViewControllerWithIdentifier(StoryboardIdentifier.Registration) as? RegisterVC else {
return
}