Commit c5c2283c by Daniel Dahan

wip: updated license to MIT

parent 676cf6fa
...@@ -171,6 +171,7 @@ ...@@ -171,6 +171,7 @@
indentWidth = 2; indentWidth = 2;
sourceTree = "<group>"; sourceTree = "<group>";
tabWidth = 2; tabWidth = 2;
usesTabs = 0;
}; };
96C98DD21E424AB000B22906 /* Products */ = { 96C98DD21E424AB000B22906 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
...@@ -338,6 +339,7 @@ ...@@ -338,6 +339,7 @@
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
English,
en, en,
); );
mainGroup = 96C98DC71E424AB000B22906; mainGroup = 96C98DC71E424AB000B22906;
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
...@@ -185,7 +182,7 @@ internal class MotionCoreAnimator<T: MotionAnimatorViewContext>: MotionAnimator ...@@ -185,7 +182,7 @@ internal class MotionCoreAnimator<T: MotionAnimatorViewContext>: MotionAnimator
func targetState(for view: UIView) -> MotionTargetState? { func targetState(for view: UIView) -> MotionTargetState? {
return context[view] return context[view]
} }
/** /**
Returns snapshot view for the given view. Returns snapshot view for the given view.
- Parameter for view: A UIView. - Parameter for view: A UIView.
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2018, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
......
/* /*
* Copyright (C) 2015 - 2018, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * The MIT License (MIT)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright notice, this * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* list of conditions and the following disclaimer. * All rights reserved.
* *
* * Redistributions in binary form must reproduce the above copyright notice, * Permission is hereby granted, free of charge, to any person obtaining a copy
* this list of conditions and the following disclaimer in the documentation * of this software and associated documentation files (the "Software"), to deal
* and/or other materials provided with the distribution. * in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* *
* * Neither the name of CosmicMind nor the names of its * The above copyright notice and this permission notice shall be included in
* contributors may be used to endorse or promote products derived from * all copies or substantial portions of the Software.
* this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * THE SOFTWARE.
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
import UIKit import UIKit
internal class Application { internal class Application {
static var shared: UIApplication { static var shared: UIApplication {
let sharedSelector = NSSelectorFromString("sharedApplication") let sharedSelector = NSSelectorFromString("sharedApplication")
guard UIApplication.responds(to: sharedSelector) else { guard UIApplication.responds(to: sharedSelector) else {
fatalError("[Motion: Extensions cannot access Application]") fatalError("[Motion: Extensions cannot access Application]")
}
let shared = UIApplication.perform(sharedSelector)
return shared?.takeUnretainedValue() as! UIApplication
} }
let shared = UIApplication.perform(sharedSelector)
return shared?.takeUnretainedValue() as! UIApplication
}
} }
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
...@@ -27,7 +27,7 @@ import UIKit ...@@ -27,7 +27,7 @@ import UIKit
internal extension CALayer { internal extension CALayer {
/// Swizzle the `add(_:forKey:) selector. /// Swizzle the `add(_:forKey:) selector.
internal static var motionAddedAnimations: [(CALayer, String, CAAnimation)]? = { static var motionAddedAnimations: [(CALayer, String, CAAnimation)]? = {
let swizzling: (AnyClass, Selector, Selector) -> Void = { forClass, originalSelector, swizzledSelector in let swizzling: (AnyClass, Selector, Selector) -> Void = { forClass, originalSelector, swizzledSelector in
if let originalMethod = class_getInstanceMethod(forClass, originalSelector), let swizzledMethod = class_getInstanceMethod(forClass, swizzledSelector) { if let originalMethod = class_getInstanceMethod(forClass, originalSelector), let swizzledMethod = class_getInstanceMethod(forClass, swizzledSelector) {
method_exchangeImplementations(originalMethod, swizzledMethod) method_exchangeImplementations(originalMethod, swizzledMethod)
...@@ -293,7 +293,7 @@ private extension CALayer { ...@@ -293,7 +293,7 @@ private extension CALayer {
/** /**
Updates the model with values provided in animation. Updates the model with values provided in animation.
- Parameter animation: A CAAnimation. - Parameter animation: A CAAnimation.
*/ */
func updateModel(_ animation: CAAnimation) { func updateModel(_ animation: CAAnimation) {
if let a = animation as? CABasicAnimation { if let a = animation as? CABasicAnimation {
setValue(a.toValue, forKeyPath: a.keyPath!) setValue(a.toValue, forKeyPath: a.keyPath!)
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
The MIT License (MIT) /*
* The MIT License (MIT)
Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. *
All rights reserved. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy *
of this software and associated documentation files (the "Software"), to deal * Permission is hereby granted, free of charge, to any person obtaining a copy
in the Software without restriction, including without limitation the rights * of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * in the Software without restriction, including without limitation the rights
copies of the Software, and to permit persons to whom the Software is * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions: * copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in *
all copies or substantial portions of the Software. * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
THE SOFTWARE. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
...@@ -233,53 +230,53 @@ public extension MotionContext { ...@@ -233,53 +230,53 @@ public extension MotionContext {
case .optimized: case .optimized:
#if os(tvOS) #if os(tvOS)
snapshot = view.snapshotView(afterScreenUpdates: true)! snapshot = view.snapshotView(afterScreenUpdates: true)!
#else #else
if #available(iOS 9.0, *), let stackView = view as? UIStackView { if #available(iOS 9.0, *), let stackView = view as? UIStackView {
snapshot = stackView.slowSnapshotView() snapshot = stackView.slowSnapshotView()
} else if let imageView = view as? UIImageView, view.subviews.isEmpty { } else if let imageView = view as? UIImageView, view.subviews.isEmpty {
let contentView = UIImageView(image: imageView.image) let contentView = UIImageView(image: imageView.image)
contentView.frame = imageView.bounds contentView.frame = imageView.bounds
contentView.contentMode = imageView.contentMode contentView.contentMode = imageView.contentMode
contentView.tintColor = imageView.tintColor contentView.tintColor = imageView.tintColor
contentView.backgroundColor = imageView.backgroundColor contentView.backgroundColor = imageView.backgroundColor
let snapShotView = UIView() let snapShotView = UIView()
snapShotView.addSubview(contentView) snapShotView.addSubview(contentView)
snapshot = snapShotView snapshot = snapShotView
} else if let barView = view as? UINavigationBar, barView.isTranslucent { } else if let barView = view as? UINavigationBar, barView.isTranslucent {
let newBarView = UINavigationBar(frame: barView.frame) let newBarView = UINavigationBar(frame: barView.frame)
newBarView.barStyle = barView.barStyle newBarView.barStyle = barView.barStyle
newBarView.tintColor = barView.tintColor newBarView.tintColor = barView.tintColor
newBarView.barTintColor = barView.barTintColor newBarView.barTintColor = barView.barTintColor
newBarView.clipsToBounds = false newBarView.clipsToBounds = false
// take a snapshot without the background // take a snapshot without the background
barView.layer.sublayers![0].opacity = 0 barView.layer.sublayers![0].opacity = 0
let realSnapshot = barView.snapshotView(afterScreenUpdates: true)! let realSnapshot = barView.snapshotView(afterScreenUpdates: true)!
barView.layer.sublayers![0].opacity = 1 barView.layer.sublayers![0].opacity = 1
newBarView.addSubview(realSnapshot) newBarView.addSubview(realSnapshot)
snapshot = newBarView snapshot = newBarView
} else if let effectView = view as? UIVisualEffectView { } else if let effectView = view as? UIVisualEffectView {
snapshot = UIVisualEffectView(effect: effectView.effect) snapshot = UIVisualEffectView(effect: effectView.effect)
snapshot.frame = effectView.bounds snapshot.frame = effectView.bounds
} else { } else {
snapshot = view.snapshotView() ?? UIView() snapshot = view.snapshotView() ?? UIView()
} }
#endif #endif
} }
#if os(tvOS) #if os(tvOS)
if let imageView = view as? UIImageView, imageView.adjustsImageWhenAncestorFocused { if let imageView = view as? UIImageView, imageView.adjustsImageWhenAncestorFocused {
snapshot.frame = imageView.focusedFrameGuide.layoutFrame snapshot.frame = imageView.focusedFrameGuide.layoutFrame
} }
#endif #endif
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2018, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
...@@ -44,7 +44,7 @@ open class MotionViewTransition { ...@@ -44,7 +44,7 @@ open class MotionViewTransition {
/// A UIView whose subviews and itself will be animating during a transition. /// A UIView whose subviews and itself will be animating during a transition.
private weak var container: UIView? private weak var container: UIView?
/// Maximum duration of the animations. /// Maximum duration of the animations.
open private(set) var totalDuration: TimeInterval = 0 open private(set) var totalDuration: TimeInterval = 0
...@@ -58,7 +58,7 @@ open class MotionViewTransition { ...@@ -58,7 +58,7 @@ open class MotionViewTransition {
private var currentDuration: TimeInterval { private var currentDuration: TimeInterval {
return totalDuration * Double(progress) return totalDuration * Double(progress)
} }
/** /**
An initializer that accepts a container transition view. An initializer that accepts a container transition view.
- Parameter container: A UIView. - Parameter container: A UIView.
...@@ -66,7 +66,7 @@ open class MotionViewTransition { ...@@ -66,7 +66,7 @@ open class MotionViewTransition {
fileprivate init(_ container: UIView) { fileprivate init(_ container: UIView) {
self.container = container self.container = container
} }
/// Prepares the transition animations. /// Prepares the transition animations.
open func start() { open func start() {
guard let v = container else { guard let v = container else {
...@@ -149,7 +149,7 @@ private extension MotionViewTransition { ...@@ -149,7 +149,7 @@ private extension MotionViewTransition {
guard shouldUpdateModels else { guard shouldUpdateModels else {
return return
} }
walkingThroughAnimations { layer, _, anim in walkingThroughAnimations { layer, _, anim in
/// bounds.size somehow is directly set on the layer. /// bounds.size somehow is directly set on the layer.
let toValue = anim.keyPath == "bounds.size" ? layer.bounds.size : anim.toValue let toValue = anim.keyPath == "bounds.size" ? layer.bounds.size : anim.toValue
...@@ -167,7 +167,7 @@ private extension MotionViewTransition { ...@@ -167,7 +167,7 @@ private extension MotionViewTransition {
layer.removeAnimation(forKey: key) layer.removeAnimation(forKey: key)
} }
} }
/** /**
Walks through each layer's animation and executes give closure with Walks through each layer's animation and executes give closure with
CALayer, animation key String, and CABasicAnimation. CALayer, animation key String, and CABasicAnimation.
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
...@@ -238,19 +235,19 @@ fileprivate extension MotionTransition { ...@@ -238,19 +235,19 @@ fileprivate extension MotionTransition {
/// Processes the animations. /// Processes the animations.
func processAnimation() { func processAnimation() {
#if os(tvOS) #if os(tvOS)
animate() animate()
#else #else
if isNavigationController { if isNavigationController {
// When animating within navigationController, we have to dispatch later into the main queue. // When animating within navigationController, we have to dispatch later into the main queue.
// otherwise snapshots will be pure white. Possibly a bug with UIKit // otherwise snapshots will be pure white. Possibly a bug with UIKit
Motion.async { [weak self] in Motion.async { [weak self] in
self?.animate() self?.animate()
}
} else {
animate()
} }
} else {
animate()
}
#endif #endif
} }
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
...@@ -32,7 +29,7 @@ extension MotionTransition: UITabBarControllerDelegate { ...@@ -32,7 +29,7 @@ extension MotionTransition: UITabBarControllerDelegate {
public func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { public func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
guard false != tabBarController.previousTabBarDelegate?.tabBarController?(tabBarController, shouldSelect: viewController) else { guard false != tabBarController.previousTabBarDelegate?.tabBarController?(tabBarController, shouldSelect: viewController) else {
return false return false
} }
if isTransitioning { if isTransitioning {
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
......
/* /*
* The MIT License (MIT) * The MIT License (MIT)
* *
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights * in the Software without restriction, including without limitation the rights
...@@ -269,7 +266,7 @@ open class MotionTransition: NSObject { ...@@ -269,7 +266,7 @@ open class MotionTransition: NSObject {
/// Whether or not we are presenting the destination view controller. /// Whether or not we are presenting the destination view controller.
public internal(set) var isPresenting = true public internal(set) var isPresenting = true
/** /**
A boolean indicating if the transition is of modal type. A boolean indicating if the transition is of modal type.
True if `viewController.present(_:animated:completion:)` or True if `viewController.present(_:animated:completion:)` or
...@@ -435,10 +432,10 @@ open class MotionTransition: NSObject { ...@@ -435,10 +432,10 @@ open class MotionTransition: NSObject {
progressRunner.start(progress: progress * duration, duration: duration, isReversed: !isFinishing) progressRunner.start(progress: progress * duration, duration: duration, isReversed: !isFinishing)
} }
private func delegate(respondingTo selector: Selector?) -> NSObjectProtocol? { private func delegate(respondingTo selector: Selector?) -> NSObjectProtocol? {
guard let selector = selector else { return nil } guard let selector = selector else { return nil }
/// Workaround for recursion happening during navigationController transtion. /// Workaround for recursion happening during navigationController transtion.
/// Avoiding private selectors (e.g _shouldCrossFadeBottomBars) /// Avoiding private selectors (e.g _shouldCrossFadeBottomBars)
guard !selector.description.starts(with: "_") else { return nil } guard !selector.description.starts(with: "_") else { return nil }
...@@ -576,7 +573,7 @@ public extension MotionTransition { ...@@ -576,7 +573,7 @@ public extension MotionTransition {
func setContainerBackgroundColorForNextTransition(_ color: UIColor) { func setContainerBackgroundColorForNextTransition(_ color: UIColor) {
containerBackgroundColor = color containerBackgroundColor = color
} }
/** /**
Set the completion callback closure for the next transition. Set the completion callback closure for the next transition.
- Parameter _ completion: An optional closure receiving a Boolean indicating if transition is finishing or cancelling. - Parameter _ completion: An optional closure receiving a Boolean indicating if transition is finishing or cancelling.
...@@ -603,8 +600,8 @@ internal extension MotionTransition { ...@@ -603,8 +600,8 @@ internal extension MotionTransition {
} }
if transitionContext == nil { if transitionContext == nil {
fvc.beginAppearanceTransition(false, animated: true) fvc.beginAppearanceTransition(false, animated: true)
tvc.beginAppearanceTransition(true, animated: true) tvc.beginAppearanceTransition(true, animated: true)
} }
processForMotionDelegate(viewController: fvc) { [weak self] in processForMotionDelegate(viewController: fvc) { [weak self] in
...@@ -642,8 +639,8 @@ internal extension MotionTransition { ...@@ -642,8 +639,8 @@ internal extension MotionTransition {
} }
if transitionContext == nil { if transitionContext == nil {
tvc.endAppearanceTransition() tvc.endAppearanceTransition()
fvc.endAppearanceTransition() fvc.endAppearanceTransition()
} }
processForMotionDelegate(viewController: fvc) { [weak self] in processForMotionDelegate(viewController: fvc) { [weak self] in
......
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