Skip to content

Commit

Permalink
stability updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dahan committed Mar 22, 2017
1 parent 1166d3c commit 0131c12
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Motion.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Motion'
s.version = '1.0.5'
s.version = '1.0.6'
s.license = 'BSD-3-Clause'
s.summary = 'Seamless animations and transitions in Swift.'
s.homepage = 'http://cosmicmind.com'
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.5</string>
<string>1.0.6</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
13 changes: 6 additions & 7 deletions Sources/Motion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ extension UIViewController {
- Returns: An optional UIViewControllerAnimatedTransitioning.
*/
open func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return isMotionEnabled ? Motion() : nil
return isMotionEnabled ? Motion(isPresenting: false, isContainer: false) : nil
}

/**
Expand Down Expand Up @@ -303,8 +303,7 @@ open class MotionPresentationController: UIPresentationController {
presentedViewController.transitionCoordinator?.animate(alongsideTransition: { (context) in })
}

open override func presentationTransitionDidEnd(_ completed: Bool) {
}
open override func presentationTransitionDidEnd(_ completed: Bool) {}

open override func dismissalTransitionWillBegin() {
guard nil != containerView else {
Expand All @@ -314,8 +313,7 @@ open class MotionPresentationController: UIPresentationController {
presentedViewController.transitionCoordinator?.animate(alongsideTransition: { (context) in })
}

open override func dismissalTransitionDidEnd(_ completed: Bool) {
}
open override func dismissalTransitionDidEnd(_ completed: Bool) {}

open override var frameOfPresentedViewInContainerView: CGRect {
return containerView?.bounds ?? .zero
Expand Down Expand Up @@ -380,7 +378,7 @@ open class Motion: NSObject {

/// The view that is being transitioned to.
open var toView: UIView {
return transitionContext.view(forKey: .to)!
return toViewController.view
}

/// The subviews of the view being transitioned to.
Expand All @@ -390,7 +388,7 @@ open class Motion: NSObject {

/// The view that is being transitioned from.
open var fromView: UIView {
return transitionContext.view(forKey: .from)!
return fromViewController.view
}

/// The subviews of the view being transitioned from.
Expand Down Expand Up @@ -585,6 +583,7 @@ extension Motion {
toView.isHidden = isPresenting
containerView.insertSubview(toView, belowSubview: transitionView)

toView.frame = fromView.frame
toView.updateConstraints()
toView.setNeedsLayout()
toView.layoutIfNeeded()
Expand Down

0 comments on commit 0131c12

Please sign in to comment.