ios - How can I prevent the unbalanced calls method during a container transition? -


i'm getting "unbalanced calls begin/end appearance transitions " when transition between child view controllers.

i'm pretty sure it's because add child view controller , transitionfromviewcontroller methods adds again.

but need add subview setup constraints auto layout.

@ibaction func flipaction(sender: anyobject) {      var nextviewcontroller = self.currentviewcontroller == self.frontviewcontroller ? self.backviewcontroller : self.frontviewcontroller      self.currentviewcontroller.willmovetoparentviewcontroller(nil)     self.addchildviewcontroller(nextviewcontroller)      nextviewcontroller.view.frame = self.containerview.frame     self.containerview.addsubview(nextviewcontroller.view)     nextviewcontroller.view.settranslatesautoresizingmaskintoconstraints(false)      self.containerview.addconstraints(nslayoutconstraint.constraintswithvisualformat("h:|-[back]-|", options: nslayoutformatoptions.allzeros, metrics: nil, views: ["back": nextviewcontroller.view]))     self.containerview.addconstraints(nslayoutconstraint.constraintswithvisualformat("v:|-[back]-|", options: nslayoutformatoptions.allzeros, metrics: nil, views: ["back": nextviewcontroller.view]))      self.transitionfromviewcontroller(self.currentviewcontroller, toviewcontroller: nextviewcontroller, duration: 1, options: uiviewanimationoptions.transitionflipfromright, animations: { () -> void in      }) { (success: bool) -> void in          self.currentviewcontroller.removefromparentviewcontroller()         nextviewcontroller.didmovetoparentviewcontroller(self)         self.currentviewcontroller = nextviewcontroller     } } 

how can prevent unbalanced calls method?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -