1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-10-10 19:37:32 +03:00

Animations collections extension refactoring

This commit is contained in:
Victor Sukochev 2016-04-13 15:04:27 +06:00
parent 9715b3de92
commit 53439bec81
2 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -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)
}