Back to Hero

HeroExtension

docs/docsets/Hero.docset/Contents/Resources/Documents/Classes/HeroExtension.html

1.6.47.6 KB
Original Source

HeroExtension

public class HeroExtension<Base>

Undocumented

Show on GitHub

`

                base
                `

Undocumented

Declaration

Swift

public let base: Base

Show on GitHub

Available where Base: UIView

`

                id
                `

ID is the identifier for the view. When doing a transition between two view controllers, Hero will search through all the subviews for both view controllers and matches views with the same heroID.

Whenever a pair is discovered, Hero will automatically transit the views from source state to the destination state.

Declaration

Swift

var id: String? { get set }

Show on GitHub

`

                isEnabled
                `

isEnabled allows to specify whether a view and its subviews should be consider for animations. If true, Hero will search through all the subviews for heroIds and modifiers. Defaults to true

Declaration

Swift

var isEnabled: Bool { get set }

Show on GitHub

`

                isEnabledForSubviews
                `

isEnabledForSubviews allows to specify whether a view’s subviews should be consider for animations. If true, Hero will search through all the subviews for heroIds and modifiers. Defaults to true

Declaration

Swift

var isEnabledForSubviews: Bool { get set }

Show on GitHub

`

                modifiers
                `

Use modifiers to specify animations alongside the main transition. Checkout HeroModifier.swift for available modifiers.

Declaration

Swift

var modifiers: [HeroModifier]? { get set }

Show on GitHub

`

                modifierString
                `

modifierString** provides another way to set modifiers. It can be assigned through storyboard.

Declaration

Swift

var modifierString: String? { get set }

Show on GitHub

Available where Base: UIViewController

`

                modalAnimationType
                `

default hero animation type for presenting & dismissing modally

Declaration

Swift

var modalAnimationType: HeroDefaultAnimationType { get set }

Show on GitHub

`

                modalAnimationTypeString
                `

Undocumented

Declaration

Swift

var modalAnimationTypeString: String? { get set }

Show on GitHub

`

                isEnabled
                `

Undocumented

Declaration

Swift

var isEnabled: Bool { get set }

Show on GitHub

Available where Base: UINavigationController

`

                navigationAnimationType
                `

default hero animation type for push and pop within the navigation controller

Declaration

Swift

var navigationAnimationType: HeroDefaultAnimationType { get set }

Show on GitHub

`

                navigationAnimationTypeString
                `

Undocumented

Declaration

Swift

var navigationAnimationTypeString: String? { get set }

Show on GitHub

Available where Base: UITabBarController

`

                tabBarAnimationType
                `

default hero animation type for switching tabs within the tab bar controller

Declaration

Swift

var tabBarAnimationType: HeroDefaultAnimationType { get set }

Show on GitHub

`

                tabBarAnimationTypeString
                `

Undocumented

Declaration

Swift

var tabBarAnimationTypeString: String? { get set }

Show on GitHub

Available where Base: UIViewController

`

                dismissViewController(completion:)
                `

Dismiss the current view controller with animation. Will perform a navigationController.popViewController if the current view controller is contained inside a navigationController

Declaration

Swift

func dismissViewController(completion: (() -> Void)? = nil)

Show on GitHub

`

                unwindToRootViewController()
                `

Unwind to the root view controller using Hero

Declaration

Swift

func unwindToRootViewController()

Show on GitHub

`

                unwindToViewController(_:)
                `

Unwind to a specific view controller using Hero

Declaration

Swift

func unwindToViewController(_ toViewController: UIViewController)

Show on GitHub

`

                unwindToViewController(withSelector:)
                `

Undocumented

Declaration

Swift

func unwindToViewController(withSelector: Selector)

Show on GitHub

`

                unwindToViewController(withClass:)
                `

Unwind to a view controller with given class using Hero

Declaration

Swift

func unwindToViewController(withClass: AnyClass)

Show on GitHub

`

                unwindToViewController(withMatchBlock:)
                `

Unwind to a view controller that the matchBlock returns true on.

Declaration

Swift

func unwindToViewController(withMatchBlock: (UIViewController) -> Bool)

Show on GitHub

`

                replaceViewController(with:completion:)
                `

Replace the current view controller with another VC on the navigation/modal/root view of UIWindow stack.

Declaration

Swift

func replaceViewController(with next: UIViewController, completion: (() -> Void)? = nil)

Show on GitHub