I have a button in my SettingsViewController
that when pressed, I want to present the same instance of my TimerViewController
each time the button is pressed.
I think I have gotten fairly close with this post here, iOS Swift, returning to the same instance of a view controller. So if you could point me to saving the instance of TimerViewController
, that would work the best.
This is the code I have right now -
var yourVariable : UIViewController!
if yourVariable == nil {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
yourVariable = storyboard.instantiateViewControllerWithIdentifier("timer") as! TimerInterface
}
presentViewController(yourVariable, animated: true, completion: nil)