I'm making an ios app and I want the user to be presented with a different page on load if they have selected an option.
override func viewDidLoad() {
super.viewDidLoad()
if UserDefaults.standard.object(forKey: "setting") == nil{
//dostuff
}
else {
goToNextPage()
}
This does not work. But when I put a timer to keep trying every 0.5 seconds it works. What am I missing here? What's going on behind the scenes that won't allow my segue to be called?
Thanks for any help :)