Comments (7)
Hi, thank you for opening the issue. I realized the same problem. In iOS 10, it seems that UINavigationControllerDelegate
does not call navigationController:interactionControllerFor:
and navigationController:animationControllerFor:from:to:
. But I solved this problem. Check this commit (b043764). Furthermore I made branches for new Swift version. You can build this immediately in Xcode 8 GM seed.
https://github.com/WorldDownTown/ZoomTransitioning/tree/swift-2.3
https://github.com/WorldDownTown/ZoomTransitioning/tree/swift-3
from zoomtransitioning.
Wow, that's great! Thank you for the quick reply.
I'll check it out.
Have a great weekend!
from zoomtransitioning.
It's looking better, but once you start the edge pan gesture there's no way of canceling the transition. Apparently the UIPercentDrivenInteractiveTransition's cancel() method does not interrupt the pop transition once it's initiated. ( UIKit shenanigans i suspect )
To work around this, you might consider replacing the cancel() call with update(0.0), to revert the animation back. It will look like this:
case .cancelled, .ended:
guard let view = recognizer.view else { return }
let progress = recognizer.translation(in: view).x / view.bounds.width
let velocity = recognizer.velocity(in: view).x
if progress > 0.33 || velocity > 1000.0 {
finish()
} else {
update(0.0)
}
interactive = false
default:
break
}
Thanks again. Was really helpful 👍
from zoomtransitioning.
Just noticed that the approach I suggested above works fine for the edge pan gesture transition, but will freeze the back button on navigation controller, sorry. 🙁
from zoomtransitioning.
I think this time i found a IOS10 workaround that works, :
// MARK: - UIGestureRecognizerDelegate
extension ZoomInteractiveTransition: UIGestureRecognizerDelegate {
public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
interactive = true
if #available(iOS 10.0, *) {
// store the popped viewController, to be added back to the navigation stack
vc = navigationController?.popViewController(animated: true)
}
return true
}
On ZoomInteractiveTransition class
weak var vc: UIViewController?
. . .
// on handlePanGestureRecognizer(_:)
case .cancelled, .ended:
. . .
if progress > 0.33 || velocity > 1000.0 {
finish()
} else {
// add back the popped view controller into the navigation stack
navigationController?.viewControllers.append(vc!)
update(0.0)
cancel()
}
interactive = false
default:
break
}
On ZoomTransitioning's animateTransitionForPop(_:), call transitionContext.completeTransition always with true
fileprivate func animateTransitionForPop(_ transitionContext: UIViewControllerContextTransitioning) {
...
UIView.animate(
..
},
completion: { _ in
...
transitionContext.completeTransition(true)
})
}
This is the best i could come up with. It's pretty awful. Give it a try, hope it helps.
from zoomtransitioning.
Oh, great idea! I checked that code, then it worked fine for me. I have adopted your solution.
from zoomtransitioning.
So the problem was solved, I close this issue.
from zoomtransitioning.
Related Issues (12)
- Manual Installation
- Cocoapods is still delivering v1.1.2 HOT 2
- About zoomTransition from round imageView to another round ImageView HOT 1
- CollectionView offset after coming back from detail view
- iOS10, trigger system interactivePopGestureRecognizer will pop twice HOT 1
- Device orientation bug HOT 2
- Update Swift 4 HOT 2
- Objective-c
- Can't go back from collectionViewController and Animation not working if the inheritance is more than 2 ViewControllers HOT 2
- Unable to find pod HOT 3
- Requirements iOS version HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zoomtransitioning.