Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Added speed variable to button pop animations. Fixes #43
  • Loading branch information
yigitserin committed Jul 21, 2016
1 parent f3f02fd commit 2b8f190
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions KCFloatingActionButton/KCFloatingActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public class KCFloatingActionButton: UIView {
Degrees to rotate image
*/
@IBInspectable public var rotationDegrees: CGFloat = -45

/**
Animation speed of buttons
*/
@IBInspectable public var animationSpeed: Double = 0.1
/**
Button color.
*/
Expand Down Expand Up @@ -689,7 +694,7 @@ extension KCFloatingActionButton {
item.alpha = 1
}, completion: nil)

delay += 0.1
delay += animationSpeed
}
}

Expand All @@ -701,7 +706,7 @@ extension KCFloatingActionButton {
item.layer.transform = CATransform3DMakeScale(0.4, 0.4, 1)
item.alpha = 0
}, completion: nil)
delay += 0.1
delay += animationSpeed
}
}

Expand All @@ -722,7 +727,7 @@ extension KCFloatingActionButton {
item.alpha = 1
}, completion: nil)

delay += 0.2
delay += animationSpeed * 2
}
}

Expand All @@ -736,7 +741,7 @@ extension KCFloatingActionButton {
animations: { () -> Void in
item.alpha = 0
}, completion: nil)
delay += 0.2
delay += animationSpeed * 2
}
}

Expand All @@ -759,7 +764,7 @@ extension KCFloatingActionButton {
item.alpha = 1
}, completion: nil)

delay += 0.1
delay += animationSpeed
}
}

Expand All @@ -771,7 +776,7 @@ extension KCFloatingActionButton {
item.frame.origin.x = UIScreen.mainScreen().bounds.size.width - self.frame.origin.x
item.alpha = 0
}, completion: nil)
delay += 0.1
delay += animationSpeed
}
}

Expand Down

0 comments on commit 2b8f190

Please sign in to comment.