mirror of
https://github.com/exyte/Macaw.git
synced 2024-10-11 03:49:05 +03:00
Animations collections extension refactoring
This commit is contained in:
parent
9715b3de92
commit
53439bec81
@ -16,15 +16,15 @@ class PathExampleView: MacawView {
|
||||
|
||||
if paused {
|
||||
playerBtn?.setTitle("Play", forState: .Normal)
|
||||
animation.pauseAnimation()
|
||||
animation.pauseAnimations()
|
||||
} else {
|
||||
playerBtn?.setTitle("Pause", forState: .Normal)
|
||||
animation.playAnimation()
|
||||
animation.playAnimations()
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func onProgressChanged(sender: UISlider) {
|
||||
animation.moveToAnimationPosition(Double(sender.value)) // currentProgress.set(Double(sender.value))
|
||||
animation.moveAnimationsToPosition(Double(sender.value)) // currentProgress.set(Double(sender.value))
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
import Foundation
|
||||
|
||||
public extension SequenceType where Generator.Element: Animatable {
|
||||
func playAnimation() {
|
||||
func playAnimations() {
|
||||
self.forEach { animation in
|
||||
animation.play()
|
||||
}
|
||||
}
|
||||
|
||||
func pauseAnimation() {
|
||||
func pauseAnimations() {
|
||||
self.forEach { animation in
|
||||
animation.pause()
|
||||
}
|
||||
@ -19,7 +19,7 @@ public extension SequenceType where Generator.Element: Animatable {
|
||||
}
|
||||
}
|
||||
|
||||
func moveToAnimationPosition(position: Double) {
|
||||
func moveAnimationsToPosition(position: Double) {
|
||||
self.forEach { animation in
|
||||
animation.moveToPosition(position)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user