HeroTransition

open class HeroTransition : NSObject

Undocumented

  • Update the progress for the interactive transition.

    • progress: the current progress, must be between 0…1

    Declaration

    Swift

    public func update(_ percentageComplete: CGFloat)
  • Finish the interactive transition. Will stop the interactive transition and animate from the current state to the end state

    Declaration

    Swift

    public func finish(animate: Bool = true)
  • Cancel the interactive transition. Will stop the interactive transition and animate from the current state to the beginning state

    Declaration

    Swift

    public func cancel(animate: Bool = true)
  • Override modifiers during an interactive animation.

    For example:

    Hero.shared.apply([.position(x:50, y:50)], to:view)

    will set the view’s position to 50, 50

    • modifiers: the modifiers to override
    • view: the view to override to

    Declaration

    Swift

    public func apply(modifiers: [HeroModifier], to view: UIView)
  • Override target state during an interactive animation.

    For example:

    Hero.shared.changeTarget([.position(x:50, y:50)], to:view)

    will animate the view’s position to 50, 50 once finish(animate:) is called

    • modifiers: the modifiers to override
    • isDestination: if false, it changes the starting state
    • view: the view to override to

    Declaration

    Swift

    public func changeTarget(modifiers: [HeroModifier], isDestination: Bool = true, to view: UIView)