Commit 83ab6b00 by Daniel Dahan

UIViewController.motionModalTransitionType renamed to UIViewController.motionTransitionType

parent b9a25764
## 1.2.5
* `UIViewController.motionModalTransitionType` renamed to `UIViewController.motionTransitionType`.
## 1.2.4 ## 1.2.4
* Added begin / end transition methods for from / to view controllers. * Added begin / end transition methods for from / to view controllers.
......
...@@ -74,8 +74,8 @@ extension UIViewController { ...@@ -74,8 +74,8 @@ extension UIViewController {
} }
} }
/// default motion animation type for presenting & dismissing modally /// Default motion animation type for presenting & dismissing modally.
public var motionModalTransitionType: MotionTransitionType { public var motionTransitionType: MotionTransitionType {
get { get {
return associatedInstance.modalTransitionType return associatedInstance.modalTransitionType
} }
...@@ -84,7 +84,7 @@ extension UIViewController { ...@@ -84,7 +84,7 @@ extension UIViewController {
} }
} }
/// used for .overFullScreen presentation /// Used for .overFullScreen presentation.
internal var motionStoredSnapshot: UIView? { internal var motionStoredSnapshot: UIView? {
get { get {
return associatedInstance.storedSnapshot return associatedInstance.storedSnapshot
...@@ -200,22 +200,30 @@ extension UIViewController { ...@@ -200,22 +200,30 @@ extension UIViewController {
/// Unwind to the root view controller using Motion. /// Unwind to the root view controller using Motion.
@IBAction @IBAction
public func motionUnwindToRootViewController() { public func motionUnwindToRootViewController() {
motionUnwindToViewController { $0.presentingViewController == nil } motionUnwindToViewController {
nil == $0.presentingViewController
}
} }
/// Unwind to a specific view controller using Motion. /// Unwind to a specific view controller using Motion.
public func motionUnwindToViewController(_ toViewController: UIViewController) { public func motionUnwindToViewController(_ toViewController: UIViewController) {
motionUnwindToViewController { $0 == toViewController } motionUnwindToViewController {
$0 == toViewController
}
} }
/// Unwind to a view controller that responds to the given selector using Motion. /// Unwind to a view controller that responds to the given selector using Motion.
public func motionUnwindToViewController(withSelector: Selector) { public func motionUnwindToViewController(withSelector: Selector) {
motionUnwindToViewController { $0.responds(to: withSelector) } motionUnwindToViewController {
$0.responds(to: withSelector)
}
} }
/// Unwind to a view controller with given class using Motion /// Unwind to a view controller with given class using Motion
public func motionUnwindToViewController(withClass: AnyClass) { public func motionUnwindToViewController(withClass: AnyClass) {
motionUnwindToViewController { $0.isKind(of: withClass) } motionUnwindToViewController {
$0.isKind(of: withClass)
}
} }
/// Unwind to a view controller that the matchBlock returns true on. /// Unwind to a view controller that the matchBlock returns true on.
......
...@@ -222,7 +222,7 @@ class TransitionPreprocessor: MotionPreprocessor { ...@@ -222,7 +222,7 @@ class TransitionPreprocessor: MotionPreprocessor {
} else if isTabBarController, let tabAnim = toViewController?.tabBarController?.motionTabBarTransitionType { } else if isTabBarController, let tabAnim = toViewController?.tabBarController?.motionTabBarTransitionType {
defaultAnimation = tabAnim defaultAnimation = tabAnim
} else if let modalAnim = (isPresenting ? toViewController : fromViewController)?.motionModalTransitionType { } else if let modalAnim = (isPresenting ? toViewController : fromViewController)?.motionTransitionType {
defaultAnimation = modalAnim defaultAnimation = modalAnim
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment