My app worked great in iOS8. His stream:
VC: View Controller, NVC: navigation view controller, ER: built-in root relationship between NVC and VC, PS: Push Segue, PG: software presentation
NVC1 --- (ER) β VC1 --- (PS) β NVC2 --- (ER) β VC2 etc.
The problem was that VC1- (PS) β NVC2 segue did not work, there was no freezing. Executed vc1.prepareForSegue (), but VC2 was not introduced. I experimented and found that I did not have a problem with the UITextView mentioned here. Following the breadcrumbs below, I made it work after several hours of trying in the following order (code at the end): NVC1 --- (ER) β VC1 --- (PG) β VC2
Here are the steps: As mentioned in the Segue issue in iOS9 , several NVCs don't match the style (shame on Apple by suddenly throwing what is actually recommended in your online tutorial and causing applications to break!). So I modified NVC1 --- (ER) β VC1 - (PS) β VC2, and VC2 is still built into NVC2. I got errors similar to fooobar.com/questions/15699 / .... So, I started making the transition programmatically and after solving the present and the problems with the ViewController , which leads to the message "tried to push modally on active view controller" , and then the ViewController had lifecycle problems that led to the messages "Unbalanced calls to begin/end appearance transactions" , I got the following code. Based on this experience, I really think that Apple should have left only one thing in the Xcode7 / iOS9 update.
//*********** VC1.swift. A translation of working code class VC1:UIViewController{ private var viewController2:VC2? private var showVC2: Bool = false override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) if(showVC2) { showVC2 = false self.pushVC2() } }//viewWillAppear private var info:String? // info from incoming user action. @IBAction unwindToVC1FromUserAction(incomingSegue: UIStoryboardSegue?) { // Do app-specific stuff to get info from incomingSegue and // store in self.info variables. let myboard: UIStoryBoard = self.storyboard!; self.viewController2 = myboard.instantiateViewControllerWithIdentifier( "VC2 Storyboard ID") as! VC2 self.prepareVC2() // Pass info to VC2.info, stuff you would have done in prepareForSegue showVC2= true } //unwind private func prepareVC2() { self.viewController2.info = self.info // etc.. } private func pushVC2() { self.navigationController!.pushViewController(viewController2!, animated:false) } } //class
Jitendra kulkarni
source share