I am trying to use UIPercentDrivenInteractiveTransition to allow the user to swipe a new view in from the righthand side.
All works okay apart from the warning; "Unbalanced calls to begin/end appearance transitions ...."
The fromView is connected to the toView in the Storyboard using a Custom Segue called "toRightView"
Here is the handler:
func handleRightOnStagePan(pan: UIPanGestureRecognizer)
{
//how much distance has been panned
let translation = pan.translationInView(pan.view!)
//translate to percentage based value
var d = -translation.x / CGRectGetWidth(pan.view!.bounds)
d = min(1.0, max(0.0,d))
//now deal with different states of geture recogniser
switch (pan.state) {
case UIGestureRecognizerState.Began:
//trigger start of transition
self.presentingViewController.performSegueWithIdentifier("toRightView", sender: self)
break
case UIGestureRecognizerState.Changed:
//Update progress of transition
self.updateInteractiveTransition(d)
break
default: //.Ended, .Cancelled, .Failed
if (d > 0.3) {
self.finishInteractiveTransition()
} else {
self.cancelInteractiveTransition()
}
}
} I have seen that other solutions to this warning message suggest that one transition has started before another has finished but in this case a break-point on
performSegueWithIdenfier(...)shows it is only called once.Any help with fixing this would be greatly appreciated.