Commit 577c196b by Daniel Dahan

menu backdrop animation working using native addAnimation call

parent 5f151b22
...@@ -53,6 +53,6 @@ class FeedCollectionView : UICollectionView { ...@@ -53,6 +53,6 @@ class FeedCollectionView : UICollectionView {
internal func prepareView() { internal func prepareView() {
registerClass(FeedCollectionViewCell.self, forCellWithReuseIdentifier: "FeedCollectionViewCell") registerClass(FeedCollectionViewCell.self, forCellWithReuseIdentifier: "FeedCollectionViewCell")
backgroundColor = MaterialColor.clear backgroundColor = MaterialColor.clear
contentInset = UIEdgeInsetsZero contentInset = UIEdgeInsetsMake(4, 0, 4, 0)
} }
} }
...@@ -52,14 +52,13 @@ class FeedCollectionViewCell : UICollectionViewCell { ...@@ -52,14 +52,13 @@ class FeedCollectionViewCell : UICollectionViewCell {
} }
private func prepareView() { private func prepareView() {
cardView = MaterialPulseView(frame: CGRectMake(0, 0, bounds.width, 152)) cardView = MaterialPulseView(frame: CGRectMake(4, 0, bounds.width - 8, 156))
cardView.pulseScale = false cardView.pulseScale = false
cardView.pulseColor = MaterialColor.blueGrey.base cardView.pulseColor = MaterialColor.blue.lighten4
addSubview(cardView) addSubview(cardView)
var image: UIImage? var image: UIImage?
imageView.shape = .Circle
imageView.contentsGravity = .ResizeAspectFill imageView.contentsGravity = .ResizeAspectFill
cardView.addSubview(imageView) cardView.addSubview(imageView)
...@@ -87,8 +86,6 @@ class FeedCollectionViewCell : UICollectionViewCell { ...@@ -87,8 +86,6 @@ class FeedCollectionViewCell : UICollectionViewCell {
detailLabel.backgroundColor = MaterialColor.clear detailLabel.backgroundColor = MaterialColor.clear
contentView.addSubview(detailLabel) contentView.addSubview(detailLabel)
cardView.grid.contentInsetPreset = .Square2
imageView.grid.columns = 4 imageView.grid.columns = 4
contentView.grid.columns = 8 contentView.grid.columns = 8
...@@ -98,14 +95,14 @@ class FeedCollectionViewCell : UICollectionViewCell { ...@@ -98,14 +95,14 @@ class FeedCollectionViewCell : UICollectionViewCell {
contentView contentView
] ]
titleLabel.grid.rows = 3 titleLabel.grid.rows = 4
titleLabel.grid.columns = 9 titleLabel.grid.columns = 8
moreButton.grid.rows = 3 moreButton.grid.rows = 3
moreButton.grid.columns = 2 moreButton.grid.columns = 2
moreButton.grid.offset.columns = 10 moreButton.grid.offset.columns = 10
detailLabel.grid.rows = 4 detailLabel.grid.rows = 8
detailLabel.grid.offset.rows = 4 detailLabel.grid.offset.rows = 4
contentView.grid.spacing = 8 contentView.grid.spacing = 8
......
...@@ -33,7 +33,7 @@ import UIKit ...@@ -33,7 +33,7 @@ import UIKit
class FeedCollectionViewLayout : UICollectionViewLayout { class FeedCollectionViewLayout : UICollectionViewLayout {
private var contentSize: CGSize = CGSizeZero private var contentSize: CGSize = CGSizeZero
private var layoutItems: Array<(UICollectionViewLayoutAttributes, NSIndexPath)>? private var layoutItems: Array<(UICollectionViewLayoutAttributes, NSIndexPath)>?
internal var height: CGFloat = 152 internal var height: CGFloat = 160
internal var offset: CGFloat = 1 internal var offset: CGFloat = 1
override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? { override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? {
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
......
...@@ -45,6 +45,9 @@ struct Item { ...@@ -45,6 +45,9 @@ struct Item {
} }
class MainViewController: UIViewController { class MainViewController: UIViewController {
/// Menu backdrop layer.
private lazy var menuBackdropLayer: MaterialLayer = MaterialLayer()
/// MenuView diameter. /// MenuView diameter.
private let menuViewDiameter: CGFloat = 56 private let menuViewDiameter: CGFloat = 56
...@@ -67,8 +70,9 @@ class MainViewController: UIViewController { ...@@ -67,8 +70,9 @@ class MainViewController: UIViewController {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepareView()
prepareItems() prepareItems()
prepareTableView() prepareCollectionView()
prepareNavigationBarView() prepareNavigationBarView()
prepareMenuBackdropLayer()
prepareMenuView() prepareMenuView()
} }
...@@ -106,9 +110,26 @@ class MainViewController: UIViewController { ...@@ -106,9 +110,26 @@ class MainViewController: UIViewController {
let image: UIImage? let image: UIImage?
if menuView.menu.opened { if menuView.menu.opened {
// Enable the side nav.
sideNavigationViewController?.enabled = true
// Position the menuBackdropLayer for the animation when closing.
menuBackdropLayer.addAnimation(MaterialAnimation.scale(1, duration: 0.25), forKey: nil)
menuView.menu.close() menuView.menu.close()
image = UIImage(named: "ic_add_white") image = UIImage(named: "ic_add_white")
} else { } else {
// Disable the side nav, so users can't swipe while viewing the menu.
sideNavigationViewController?.enabled = false
// Position the menuBackdropLayer for the animation when opening.
MaterialAnimation.animationDisabled { [unowned self] in
self.menuBackdropLayer.frame = self.menuView.frame
self.menuBackdropLayer.shape = .Circle
}
menuBackdropLayer.addAnimation(MaterialAnimation.scale(30, duration: 0.25), forKey: nil)
menuBackdropLayer.hidden = false
menuView.menu.open() { (v: UIView) in menuView.menu.open() { (v: UIView) in
(v as? MaterialButton)?.pulse() (v as? MaterialButton)?.pulse()
} }
...@@ -131,52 +152,52 @@ class MainViewController: UIViewController { ...@@ -131,52 +152,52 @@ class MainViewController: UIViewController {
private func prepareItems() { private func prepareItems() {
items.append(Item( items.append(Item(
title: "Raw Vegan Blackberry Tart!", title: "Raw Vegan Blackberry Tart!",
detail: "Wish I could come, but I am out of town this weekend.", detail: "Treat yourself today and every day with this sweet nutritious cake!",
image: UIImage(named: "VeganCakeFull") image: UIImage(named: "VeganCakeFull")
)) ))
items.append(Item( items.append(Item(
title: "Raw Vegan Pumpkin Pie", title: "Raw Vegan Pumpkin Pie",
detail: "Have any ideas about what we should get Heidi for her birthday?", detail: "Pumpkin lovers, desert lovers, and anyone who likes simple healthy cooking and enjoys eating! Light up your day with a piece of happiness- raw vegan pumpkin pie :)",
image: UIImage(named: "VeganPieAbove") image: UIImage(named: "VeganPieAbove")
)) ))
items.append(Item( items.append(Item(
title: "Raw Vegan Nutty Sweets!", title: "Raw Vegan Nutty Sweets!",
detail: "I'll be in your neighborhood doing errands this weekend.", detail: "Since most of my readers have a sweet tooth, here is another simple recipe to boost your happiness :)",
image: UIImage(named: "VeganHempBalls") image: UIImage(named: "VeganHempBalls")
)) ))
items.append(Item( items.append(Item(
title: "Avocado Chocolate Cake!", title: "Avocado Chocolate Cake!",
detail: "Are we on this weekend for the game?", detail: "Do you know what are the two best things about vegan food besides that it's healthy and full of nutrition? It's absolutely delicious and easy to make!",
image: UIImage(named: "AssortmentOfFood") image: UIImage(named: "AssortmentOfFood")
)) ))
items.append(Item( items.append(Item(
title: "Homemade brunch: Crepe Indulgence", title: "Homemade brunch: Crepe Indulgence",
detail: "We should eat this: Squash, Corn and tomatillo Tacos.", detail: "Looking for a perfect sunday brunch spot? How about staying in and making something to die for?:)",
image: UIImage(named: "AssortmentOfDessert") image: UIImage(named: "AssortmentOfDessert")
)) ))
items.append(Item( items.append(Item(
title: "Raw Vegan Chocolate Cookies", title: "Raw Vegan Chocolate Cookies",
detail: "The candidate will be arriving at 11:30, are you free?", detail: "Once I start making sweets it's hard for me to stop! I've got another exciting recipe, which hopefully you will love! :D",
image: UIImage(named: "HeartCookies") image: UIImage(named: "HeartCookies")
)) ))
items.append(Item( items.append(Item(
title: "Homemade Avocado Ice Cream", title: "Homemade Avocado Ice Cream",
detail: "I found the book title, Surely You’re Joking, Mr. Feynman!", detail: "Avocado ice cream (and vegan!) might not sound so appealing to some of you, but the truth is- it's mind blowing!!!",
image: UIImage(named: "AvocadoIceCream") image: UIImage(named: "AvocadoIceCream")
)) ))
} }
/// Prepares the tableView. /// Prepares the tableView.
private func prepareTableView() { private func prepareCollectionView() {
collectionView.delegate = self collectionView.delegate = self
collectionView.dataSource = self collectionView.dataSource = self
collectionView.backgroundColor = MaterialColor.blueGrey.lighten3 collectionView.backgroundColor = MaterialColor.grey.lighten4
view.addSubview(collectionView) view.addSubview(collectionView)
collectionView.translatesAutoresizingMaskIntoConstraints = false collectionView.translatesAutoresizingMaskIntoConstraints = false
...@@ -187,17 +208,18 @@ class MainViewController: UIViewController { ...@@ -187,17 +208,18 @@ class MainViewController: UIViewController {
private func prepareNavigationBarView() { private func prepareNavigationBarView() {
// Title label. // Title label.
let titleLabel: UILabel = UILabel() let titleLabel: UILabel = UILabel()
titleLabel.text = "Material" titleLabel.text = "Rcipes"
titleLabel.textAlignment = .Left titleLabel.textAlignment = .Left
titleLabel.textColor = MaterialColor.white titleLabel.textColor = MaterialColor.white
titleLabel.font = RobotoFont.regularWithSize(17) titleLabel.font = RobotoFont.regularWithSize(20)
// Detail label. // Detail label. Uncomment the code below to use a detail label.
let detailLabel: UILabel = UILabel() // let detailLabel: UILabel = UILabel()
detailLabel.text = "Build Beautiful Software" // detailLabel.text = "Build Beautiful Software"
detailLabel.textAlignment = .Left // detailLabel.textAlignment = .Left
detailLabel.textColor = MaterialColor.white // detailLabel.textColor = MaterialColor.white
detailLabel.font = RobotoFont.regularWithSize(12) // detailLabel.font = RobotoFont.regularWithSize(12)
// navigationBarView.detailLabel = detailLabel
var image = UIImage(named: "ic_menu_white") var image = UIImage(named: "ic_menu_white")
...@@ -229,13 +251,19 @@ class MainViewController: UIViewController { ...@@ -229,13 +251,19 @@ class MainViewController: UIViewController {
navigationBarView.backgroundColor = MaterialColor.blue.base navigationBarView.backgroundColor = MaterialColor.blue.base
navigationBarView.titleLabel = titleLabel navigationBarView.titleLabel = titleLabel
navigationBarView.detailLabel = detailLabel
navigationBarView.leftControls = [menuButton] navigationBarView.leftControls = [menuButton]
navigationBarView.rightControls = [switchControl, searchButton] navigationBarView.rightControls = [switchControl, searchButton]
view.addSubview(navigationBarView) view.addSubview(navigationBarView)
} }
/// Prepares the menuBackdropLayer.
private func prepareMenuBackdropLayer() {
menuBackdropLayer.backgroundColor = MaterialColor.grey.base.colorWithAlphaComponent(0.75).CGColor
menuBackdropLayer.hidden = true
view.layer.addSublayer(menuBackdropLayer)
}
/// Prepares the add button. /// Prepares the add button.
private func prepareMenuView() { private func prepareMenuView() {
var image: UIImage? = UIImage(named: "ic_add_white") var image: UIImage? = UIImage(named: "ic_add_white")
......
...@@ -41,7 +41,7 @@ public extension MaterialAnimation { ...@@ -41,7 +41,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -57,7 +57,7 @@ public extension MaterialAnimation { ...@@ -57,7 +57,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -73,7 +73,7 @@ public extension MaterialAnimation { ...@@ -73,7 +73,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -89,7 +89,7 @@ public extension MaterialAnimation { ...@@ -89,7 +89,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -105,7 +105,7 @@ public extension MaterialAnimation { ...@@ -105,7 +105,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -121,7 +121,7 @@ public extension MaterialAnimation { ...@@ -121,7 +121,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -137,7 +137,7 @@ public extension MaterialAnimation { ...@@ -137,7 +137,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -153,7 +153,7 @@ public extension MaterialAnimation { ...@@ -153,7 +153,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -169,7 +169,7 @@ public extension MaterialAnimation { ...@@ -169,7 +169,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -185,7 +185,7 @@ public extension MaterialAnimation { ...@@ -185,7 +185,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -201,7 +201,7 @@ public extension MaterialAnimation { ...@@ -201,7 +201,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -217,7 +217,7 @@ public extension MaterialAnimation { ...@@ -217,7 +217,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -233,7 +233,7 @@ public extension MaterialAnimation { ...@@ -233,7 +233,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -249,7 +249,7 @@ public extension MaterialAnimation { ...@@ -249,7 +249,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -265,7 +265,7 @@ public extension MaterialAnimation { ...@@ -265,7 +265,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
...@@ -281,7 +281,7 @@ public extension MaterialAnimation { ...@@ -281,7 +281,7 @@ public extension MaterialAnimation {
animation.fillMode = MaterialAnimationFillModeToValue(.Forwards) animation.fillMode = MaterialAnimationFillModeToValue(.Forwards)
animation.removedOnCompletion = false animation.removedOnCompletion = false
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
if let d = duration { if let d: CFTimeInterval = duration {
animation.duration = d animation.duration = d
} }
return animation return animation
......
...@@ -283,11 +283,11 @@ public class MaterialLayer : CAShapeLayer { ...@@ -283,11 +283,11 @@ public class MaterialLayer : CAShapeLayer {
if let a: CAPropertyAnimation = anim as? CAPropertyAnimation { if let a: CAPropertyAnimation = anim as? CAPropertyAnimation {
if let b: CABasicAnimation = a as? CABasicAnimation { if let b: CABasicAnimation = a as? CABasicAnimation {
MaterialAnimation.animationDisabled { [unowned self] in MaterialAnimation.animationDisabled { [unowned self] in
self.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!) // self.setValue(nil == b.toValue ? b.byValue : b.toValue, forKey: b.keyPath!)
} }
} }
(delegate as? MaterialAnimationDelegate)?.materialAnimationDidStop?(anim, finished: flag) (delegate as? MaterialAnimationDelegate)?.materialAnimationDidStop?(anim, finished: flag)
removeAnimationForKey(a.keyPath!) // removeAnimationForKey(a.keyPath!)
} else if let a: CAAnimationGroup = anim as? CAAnimationGroup { } else if let a: CAAnimationGroup = anim as? CAAnimationGroup {
for x in a.animations! { for x in a.animations! {
animationDidStop(x, finished: true) animationDidStop(x, finished: true)
......
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