1.0.0-alpha.1
Pre-releaseSorry guys for the inactivity with this project. I have been having some other commitments. From now on, I will start maintaining and updating it more often.
So to prepare for stable release 1.0, there will be a few alpha versions. I will start to clean up issues and start monitor new ones. Feel free to submit anything you have encountered while using the new versions.
New Features
-
.useNoSnapshot
will now try to insert the view back to the view hierarchy once the transition completes. So you don't need to manually insert it back.- Note: for views that have collection view or table view as the superview, Hero might not be able to insert it into the correct subview index since the collection view and table view might have altered their subviews during the transition.
-
.useNoSnapshot
will now animate subview layout changes. Very convenient when you want your custom layout be animated during the transition. -
Added
.whenXXX
modifiers to make hero more declaritive.- instead of conforming to
HeroViewControllerDelegate
, you can now use.whenPresenting
,.whenDismissing
,.whenApearing
,.whenDisapearing
,.whenMatched
, or your own conditions with.when
- instead of conforming to
-
Added
isHeroEnabledForSubviews
property on UIView. Setting this to true will let Hero skip over the subview tree. This saves a lot of computation time when the subview tree is complex. -
Better support iOS custom keyboard
-
Better support
UIVisualEffectView
-
You can now create your own instance of
HeroTransition
instead of usingisHeroEnabled
&Hero.shared
.- just create an instance of
HeroTransition
and assign it to thetransitionDelegate
property of your view controller.
- just create an instance of
-
Added
viewOrderingStrategy
property toHeroTransition
which allow you to customize which view controller should be inserted first during the transition. -
Added
isUserInteractionEnabled
property toHeroTransition
which allow you to enable user interaction during the transition.- Note: by default, Hero will create snapshot of your views and use them for animation. They don't have the same event handler as your own views. So to enable user interaction, you have to apply
.useNoSnapshot
modifier to the views that you want to enabled user interaction. Also keep in mind that Hero can be in any state when you are handling user interaction. If you want to trigger a new transition, besure to callcancel(animated: false)
orfinish(animated: false)
before starting the new transition.
- Note: by default, Hero will create snapshot of your views and use them for animation. They don't have the same event handler as your own views. So to enable user interaction, you have to apply
-
The following methods on
Hero
is removed in favor of creating your customHeroTransition
objectfunc disableDefaultAnimationForNextTransition()
func setDefaultAnimationForNextTransition(_ animation: HeroDefaultAnimationType)
func setContainerColorForNextTransition(_ color: UIColor?)
Bug fixes:
- fix the ghosting effect where the source view and target view animates at different rate
- fix tab bar crashes and inconsistency when tapping too fast.
Future Roadmap:
- Custom snapshot view
- Masking support