Comments (4)
You can probably do something like this instead of setting isHeroEnabled
.
extension ModalNavigationController: UINavigationControllerDelegate {
func navigationController(_ navigationController: UINavigationController,
willShow viewController: UIViewController,
animated: Bool) {
//need to configure something on viewController.view
}
func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return Hero.shared.navigationController(navigationController, animationControllerFor:operation, from:fromVC)
}
func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
return Hero.shared.navigationController(navigationController, interactionControllerFor:animationController)
}
}
from hero.
Hero.shared
is not avaliable on cocoapods and carthage yet. The current master contains a major API change. Will wait a few day before releasing the next version. In the mean time, you can use
pod "Hero", :git => 'https://github.com/lkzhao/Hero.git'
from hero.
I had to add nav.transitioningDelegate = Hero.shared
instead of setting isHeroEnabled
.
It turns out those two delegate methods are not being called at all. (even with setting isHeroEnabled
) - is that expected?
EDIT: Actually it get's called once I push from the rootVC to the next one, that makes sense.
from hero.
Oh. I guess I didn't understand your question clearly.
Yes, for the modal presentation you only have to set 'transitionDelegate'. Hero also sets the navigation controller's delegate for animating navigation controller's child view controllers. If you don't need that functionality then it is ok to just set the 'transitionDelegate'
from hero.
Related Issues (20)
- Animation not working for UICollectionViewDiffableDataSource HOT 1
- Request: Make HeroTransition::complete(after: TimeInterval, finishing: Bool) public
- Version 1.6.2 doesn't work with SPM HOT 16
- <Hero/Hero-Swift.h> file not found when I use “ pod 'Hero' ”.
- Animation doesn't work when navigationController pushing screen HOT 4
- OverFullScreen problem HOT 3
- HeroModifiers will fail when a nested `when` modifier exist
- 在tabbar控制器嵌套的navigation控制器中push进子页面,tabbar的显示/隐藏没有任何动画 HOT 2
- hero push animation is unable to turn off
- How do I keep the tabbar is not hidden when push
- Doesn't the demo project work? HOT 2
- Spring Modifier on dismiss view controller Hero.
- hidesBottomBarWhenPushed bug
- Demo cant be run.
- need help, match hero animation across multiple preseting viewcontollers HOT 1
- Default source code, why is there a black area at the top? HOT 2
- Black screen when removing VC
- CI/CD github action needs update to newer env
- Privacy Manifest HOT 1
- Library not loaded HOT 1
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 hero.