-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Change Log
- new properties for specifying default animations
extension UIViewController {
/// default hero animation type for presenting & dismissing modally
public var heroModalAnimationType: HeroDefaultAnimationType
}
extension UINavigationController {
/// default hero animation type for push and pop within the navigation controller
public var heroNavigationAnimationType: HeroDefaultAnimationType
}
extension UITabBarController {
/// default hero animation type for switching tabs within the tab bar controller
public var heroTabBarAnimationType: HeroDefaultAnimationType
}
- bug fixes https://github.com/lkzhao/Hero/issues/90 https://github.com/lkzhao/Hero/issues/85
- basic support for animating UIVisualEffectView's effect property in iOS 10
-
support
.overFullScreen
modalPresentationStyle -
Implement many new default transitions. (fade was the only default transition before this update)
- .push(direction: Direction)
- .pull(direction: Direction)
- .cover(direction: Direction)
- .uncover(direction: Direction)
- .slide(direction: Direction)
- .zoomSlide(direction: Direction)
- .pageIn(direction: Direction)
- .pageOut(direction: Direction)
-
a few new modifiers:
- beginWith(modifiers:[HeroModifier])
- durationMatchLongest
- overlay(color:UIColor, opacity:CGFloat)
- masksToBounds(_ masksToBounds: Bool)
- fix a zPosition regression introduced in 0.1.5
- fix a regression introduced in 0.1.5 where animation for matched view might appear inconsistent.
-
fix a bug where toViewController's delegate callbacks are not being called
-
fix a bug where fromViewController's delegate callbacks receive incorrect parameters.
-
Add useScaleBasedSizeChange modifier. Force Hero use scale based size animation. This will convert all
.size
modifier into.scale
modifier. This is to help Hero animate layers that doesn't support bounds animation. Also gives better performance when animating. -
fix a few bugs with
.useNoSnapshot
-
new video player example.
-
fix a bug where changing orientation doesn't affect previous VC. https://github.com/lkzhao/Hero/issues/60
-
fix a bug where the presented view controller has incorrect frame. https://github.com/lkzhao/Hero/issues/63, https://github.com/lkzhao/Hero/issues/56
-
New snapshot type modifiers:
-
useOptimizedSnapshot
With this modifier, Hero will create snapshot optimized for different view type when animating. For custom views or views with masking, useOptimizedSnapshot might create snapshots that appear differently than the actual view. In that case, use .useNormalSnapshot or .useSlowRenderSnapshot to disable the optimization.
-
useNormalSnapshot
Create snapshot using snapshotView(afterScreenUpdates:).
-
useLayerRenderSnapshot
Create snapshot using layer.render(in: currentContext). This is slower than .useNormalSnapshot but gives more accurate snapshot for some views (eg. UIStackView).
-
useNoSnapshot
Force Hero to not create any snapshot when animating this view. Hence Hero will animate on the view directly. This will mess up the view hierarchy. Therefore, view controllers have to rebuild its view structure after the transition finishes.
-
-
New navigation extension on UIViewController (mainly to support unwinding):
-
func hero_dismissViewController()
Dismiss the current view controller with animation. Will perform a navigationController.popViewController if the current view controller is contained inside a navigationController.
-
func hero_replaceViewController(with:UIViewController)
Replace the current view controller with another VC on the navigation/modal stack.
-
func hero_unwindToRootViewController()
Unwind to the root view controller using Hero.
-
func hero_unwindToViewController(_ toViewController:)
Unwind to a specific view controller using Hero.
-
func hero_unwindToViewController(withSelector: Selector)
Unwind to a view controller that responds to the given selector using Hero.
-
func hero_unwindToViewController(withClass: AnyClass)
Unwind to a view controller with given class using Hero.
-
func hero_unwindToViewController(withMatchBlock: (UIViewController) -> Bool)
Unwind to a view controller that the match block returns true on.
-
-
Support local coordinate space.
Global coordinate space Local (parent's) coordinate space Animating views are not affected by parent views' attributes Animating views are affected by parent views' attributes When parent view moves, subviews that have its own modifiers do not move with the parent view. I.e. they are being taken out of the view hierarchy. When parent view moves, subviews that have its own modifiers move along with the parent view. I.e. similar to how a view behave when its parent view moves. Used for matched views & views with source
modifier. Global is the default prior to 0.1.3Local is the default coordinate space after 0.1.3 -
New useGlobalCoordinateSpace modifier. Force the view to use global coordinate space. I.e. won't move with its parent view.
-
HeroPlugin
returning .infinity duration will be treated as wanting interactive transition - few bug fixes.
- Update plugin API protocol to be more concise.
- Swift Package Manager Support, Thanks to @mRs-
- Bug fixes #41, #36, & #38
- Cleaner navigation bar animation.
- Better alpha animation support.
-
add HeroModifier class and HeroTargetState struct
- HeroModifier is a swift enum-like class that provides the same functionality of the original string-based heroModifiers.
- HeroTargetState is a struct that holds view state informations. It can be build from [HeroModifier]. Mostly used internally and for building HeroPlugin.
-
change the original
heroModifiers:String?
toheroModifierString:String?
(breaking change!) -
add
heroModifiers:[HeroModifier]?
to UIView -
add a shared singleton
Hero
object for controlling the interactive transition. Which can be accessed byHero.shared
-
few changes to the protocols
-
protocol HeroAnimator
func temporarilySet(view:UIView, to modifiers:HeroModifiers) // to func temporarilySet(view:UIView, targetState:HeroTargetState)
-
protocol HeroViewControllerDelegate
@objc optional func wantInteractiveHeroTransition(context:HeroInteractiveContext) -> Bool // to @objc optional func wantInteractiveHeroTransition() -> Bool
-
remove HeroInteractiveContext protocol
-
-
update HeroPlugin to conform to the new protocols definitions.
-
rename a few modifiers:
- curve → timingFunction
- sourceID → source
- clearSubviewModifiers → ignoreSubviewModifiers
-
fix a bug with
heroReplaceViewController
API. PR 30 -
fix a bug with UIStackView not animating correctly. PR 22
-
add recursive
ignoreSubviewModifiers
modifier -
add radial & inverseRadial cascade:
Do a whole-project find & replace(cmd+option+shift+F) for:
- heroModifiers → heroModifierString
- curve → timingFunction
- sourceID → source
- clearSubviewModifiers → ignoreSubviewModifiers
Remember to also replace these inside the storyboard. In code, please migrate to the new type-safe heroModifiers
. It provides better type-checking and more functionality.
- Add live injection example
- Make
snapshotView
available to all HeroAnimators. - Add
heroWillStartTransition
&heroDidEndTransition
callbacks toHeroViewControllerDelegate
- Fix animation for UIStackView https://github.com/lkzhao/Hero/pull/18
- Smoother UIImageView animation for bounds change https://github.com/lkzhao/Hero/pull/16
- Add Carthage support
- Cleaner resume animation after an interactive transition.
- plugin API:
seekTo(progress:Double)
changed toseekTo(timePassed:TimeInterval)
- plugin API:
resume(progress:Double, reverse:Bool)
changed toresume(timePassed:TimeInterval, reverse:Bool)
- provides dynamic duration by default. material design(duration & timing)
- rename
clearSubviewClasses
toclearSubviewModifiers
. was a naming mistake. - set default animation to be CABasicAnimation with the Standard Curve from material design (easing).
- add the new arc effect from material design (movement).
- add arc effect to Basic, Menu, & ListToGrid examples.
- add the ability to show arc path in the Debug Plugin.
- ignore
HeroModifiers
for source view when matched with a target view with the sameHeroID
- some small optimization & bug fixes