func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let strategyPicker=segue.destination as! StrategyViewController
strategyPicker.folder=self.folder
NSLog("Tried to pass \(self.folder) into \(String(describing: strategyPicker.folder))")
}
Trying to debug in lldb, it seems that simply assigning segue.destination is triggering the viewDidAppear in the destination view controller. I am getting a fatal error in viewDidAppear in the destination before passing the folder. I understand that any initializer code has to run (and it does--a couple of fields are correctly initialized according to lldb e commands). It just does not make sense that the viewDidAppear is called before the prepareForSegue finishes.
I have breakpoints on the strategyPicker.folder assignment and the NSLog and neither triggers before the error in the destination viewDidAppear.
Any advice?