Commit 0eb66bf7 by Daniel Dahan

development: fixed issue with iOS 10 and animations not correctly writing final placement data

parent 483f7225
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '2.3.13' s.version = '2.3.14'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.' s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.'
s.homepage = 'http://materialswift.com' s.homepage = 'http://materialswift.com'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.3.13</string> <string>2.3.14</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -258,9 +258,12 @@ extension CALayer { ...@@ -258,9 +258,12 @@ extension CALayer {
- Parameter animation: A CAAnimation instance. - Parameter animation: A CAAnimation instance.
*/ */
open func animate(animation: CAAnimation) { open func animate(animation: CAAnimation) {
animation.delegate = self
if let a = animation as? CABasicAnimation { if let a = animation as? CABasicAnimation {
a.fromValue = (nil == presentation() ? self : presentation()!).value(forKeyPath: a.keyPath!) a.fromValue = (nil == presentation() ? self : presentation()!).value(forKeyPath: a.keyPath!)
} }
if let a = animation as? CAPropertyAnimation { if let a = animation as? CAPropertyAnimation {
add(a, forKey: a.keyPath!) add(a, forKey: a.keyPath!)
} else if let a = animation as? CAAnimationGroup { } else if let a = animation as? CAAnimationGroup {
...@@ -268,12 +271,6 @@ extension CALayer { ...@@ -268,12 +271,6 @@ extension CALayer {
} else if let a = animation as? CATransition { } else if let a = animation as? CATransition {
add(a, forKey: kCATransition) add(a, forKey: kCATransition)
} }
if #available(iOS 10, *) {
Motion.delay(time: animation.duration) { [weak self, animation = animation] in
self?.animationDidStop(animation, finished: true)
}
}
} }
/** /**
...@@ -346,3 +343,8 @@ extension CALayer { ...@@ -346,3 +343,8 @@ extension CALayer {
} }
} }
} }
@available(iOS 10, *)
extension CALayer: CAAnimationDelegate {
}
...@@ -71,7 +71,7 @@ open class RootController: UIViewController { ...@@ -71,7 +71,7 @@ open class RootController: UIViewController {
is recommended to use the transitionFromRootViewController is recommended to use the transitionFromRootViewController
helper method. helper method.
*/ */
open internal(set) var rootViewController: UIViewController! open fileprivate(set) var rootViewController: UIViewController!
/** /**
An initializer that initializes the object with a NSCoder object. An initializer that initializes the object with a NSCoder object.
...@@ -167,13 +167,15 @@ open class RootController: UIViewController { ...@@ -167,13 +167,15 @@ open class RootController: UIViewController {
view.contentScaleFactor = Screen.scale view.contentScaleFactor = Screen.scale
prepareRootViewController() prepareRootViewController()
} }
}
/// A method that prepares the rootViewController.
internal func prepareRootViewController() { extension RootController {
prepare(viewController: rootViewController, withContainer: view) /// A method that prepares the rootViewController.
} internal func prepareRootViewController() {
prepare(viewController: rootViewController, withContainer: view)
/** }
/**
A method that adds the passed in controller as a child of A method that adds the passed in controller as a child of
the BarController within the passed in the BarController within the passed in
container view. container view.
...@@ -181,7 +183,7 @@ open class RootController: UIViewController { ...@@ -181,7 +183,7 @@ open class RootController: UIViewController {
- Parameter withContainer container: A UIView that is the parent of the - Parameter withContainer container: A UIView that is the parent of the
passed in controller view within the view hierarchy. passed in controller view within the view hierarchy.
*/ */
internal func prepare(viewController: UIViewController?, withContainer container: UIView) { internal func prepare(viewController: UIViewController?, withContainer container: UIView) {
guard let v = viewController else { guard let v = viewController else {
return return
} }
...@@ -192,5 +194,5 @@ open class RootController: UIViewController { ...@@ -192,5 +194,5 @@ open class RootController: UIViewController {
v.view.clipsToBounds = true v.view.clipsToBounds = true
v.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] v.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
v.view.contentScaleFactor = Screen.scale v.view.contentScaleFactor = Screen.scale
} }
} }
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