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 {
|
if paused {
|
||||||
playerBtn?.setTitle("Play", forState: .Normal)
|
playerBtn?.setTitle("Play", forState: .Normal)
|
||||||
animation.pauseAnimation()
|
animation.pauseAnimations()
|
||||||
} else {
|
} else {
|
||||||
playerBtn?.setTitle("Pause", forState: .Normal)
|
playerBtn?.setTitle("Pause", forState: .Normal)
|
||||||
animation.playAnimation()
|
animation.playAnimations()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func onProgressChanged(sender: UISlider) {
|
@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) {
|
required init?(coder aDecoder: NSCoder) {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public extension SequenceType where Generator.Element: Animatable {
|
public extension SequenceType where Generator.Element: Animatable {
|
||||||
func playAnimation() {
|
func playAnimations() {
|
||||||
self.forEach { animation in
|
self.forEach { animation in
|
||||||
animation.play()
|
animation.play()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func pauseAnimation() {
|
func pauseAnimations() {
|
||||||
self.forEach { animation in
|
self.forEach { animation in
|
||||||
animation.pause()
|
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
|
self.forEach { animation in
|
||||||
animation.moveToPosition(position)
|
animation.moveToPosition(position)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user