Commit 1c31140b by Daniel Dahan

minor code cleanup

parent 2fd5d3b0
......@@ -142,8 +142,6 @@
96E4093B1F24F7370015A2B5 /* Sources */ = {
isa = PBXGroup;
children = (
96E4093C1F24F7370015A2B5 /* Animator */,
96E409431F24F7370015A2B5 /* Extensions */,
96E409BB1F24FC210015A2B5 /* Info.plist */,
96E409BC1F24FC300015A2B5 /* LICENSE */,
96E4094F1F24F7370015A2B5 /* Motion.h */,
......@@ -160,6 +158,8 @@
96E4095A1F24F7370015A2B5 /* MotionTransition.swift */,
96E4095B1F24F7370015A2B5 /* MotionTransitionObserver.swift */,
96E4095C1F24F7370015A2B5 /* MotionTransitionState.swift */,
96E4093C1F24F7370015A2B5 /* Animator */,
96E409431F24F7370015A2B5 /* Extensions */,
96E4095D1F24F7370015A2B5 /* Preprocessors */,
);
path = Sources;
......
......@@ -29,18 +29,18 @@
import UIKit
public extension CAMediaTimingFunction {
// default
// Default
static let linear = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
static let easeIn = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
static let easeOut = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
static let easeInOut = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
// material
// Material
static let standard = CAMediaTimingFunction(controlPoints: 0.4, 0.0, 0.2, 1.0)
static let deceleration = CAMediaTimingFunction(controlPoints: 0.0, 0.0, 0.2, 1)
static let acceleration = CAMediaTimingFunction(controlPoints: 0.4, 0.0, 1, 1)
static let sharp = CAMediaTimingFunction(controlPoints: 0.4, 0.0, 0.6, 1)
// easing.net
// Easing.net
static let easeOutBack = CAMediaTimingFunction(controlPoints: 0.175, 0.885, 0.32, 1.75)
}
......@@ -305,7 +305,7 @@ internal extension Motion {
context.clean()
if isFinished && isPresenting && toOverFullScreen {
// finished presenting a overFullScreen VC
// finished presenting a overFullScreen view controller.
context.unhide(rootView: tv)
context.removeSnapshots(rootView: tv)
context.storeViewAlpha(rootView: fv)
......@@ -314,7 +314,7 @@ internal extension Motion {
fv.removeFromSuperview()
fv.addSubview(c)
} else if !isFinished && !isPresenting && fromOverFullScreen {
// cancelled dismissing a overFullScreen VC
// Cancelled dismissing a overFullScreen view controller.
context.unhide(rootView: fv)
context.removeSnapshots(rootView: fv)
context.storeViewAlpha(rootView: tv)
......@@ -328,7 +328,7 @@ internal extension Motion {
c.removeFromSuperview()
}
// move fromView & toView back from our container back to the one supplied by UIKit
// Move fromView & toView back from our container back to the one supplied by UIKit.
if (toOverFullScreen && isFinished) || (fromOverFullScreen && !isFinished) {
tc.addSubview(isFinished ? fv : tv)
}
......@@ -336,7 +336,7 @@ internal extension Motion {
tc.addSubview(isFinished ? tv : fv)
if isPresenting != isFinished, !isContainerController {
// only happens when present a .overFullScreen VC
// Only happens when present a .overFullScreen view controller.
// bug: http://openradar.appspot.com/radar?id=5320103646199808
UIApplication.shared.keyWindow!.addSubview(isPresenting ? fv : tv)
}
......@@ -418,8 +418,9 @@ fileprivate extension Motion {
}
context.loadViewAlpha(rootView: tv)
context.loadViewAlpha(rootView: fv)
v.addSubview(tv)
context.loadViewAlpha(rootView: fv)
v.addSubview(fv)
}
......
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