Skip to content

Commit

Permalink
Merge pull request #26 from mikker/master
Browse files Browse the repository at this point in the history
Rename autoreverses to reverses (Support Swift 4)
  • Loading branch information
AugustRush committed Aug 31, 2017
2 parents f22e250 + fd9ad16 commit 8b76462
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Sources/BasicConfigurable.swift
Expand Up @@ -12,6 +12,6 @@ public protocol BasicConfigurable: BasicChainable {
func duration(_ d: CFTimeInterval) -> Self
func easing(_ type: TimingFunctionType) -> Self
func delay(_ d: CFTimeInterval) -> Self
func autoreverses() -> Self
func reverses() -> Self
func repeatCount(_ count: Int) -> Self
}
2 changes: 1 addition & 1 deletion Sources/CALayer+Stellar.swift
Expand Up @@ -220,7 +220,7 @@ extension CALayer: BasicConfigurable, SnapConfigurable, AttachmentConfigurable,
return self
}

public func autoreverses() -> Self {
public func reverses() -> Self {
context.changeAutoreverses(true)
return self
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/UIView+Stellar.swift
Expand Up @@ -228,7 +228,7 @@ extension UIView: BasicConfigurable, SnapConfigurable, AttachmentConfigurable, G
return self
}

public func autoreverses() -> Self {
public func reverses() -> Self {
context.changeAutoreverses(true)
return self
}
Expand Down
8 changes: 4 additions & 4 deletions StellarDemo/StellarDemo/Example3ViewController.swift
Expand Up @@ -19,15 +19,15 @@ class Example3ViewController: UIViewController {
for (index,line) in leftLines.enumerated() {
let delay = Double(index) * 0.2
line.moveX(200).duration(2).delay(delay)
.then().moveX(-200).makeColor(UIColor.green).easing(.linear).repeatCount(100).autoreverses().duration(2).animate()
line.makeWidth(80).delay(delay).duration(1).autoreverses().easing(.linear).repeatCount(100).animate()
.then().moveX(-200).makeColor(UIColor.green).easing(.linear).repeatCount(100).reverses().duration(2).animate()
line.makeWidth(80).delay(delay).duration(1).reverses().easing(.linear).repeatCount(100).animate()
}

for (index,line) in rightLines.enumerated() {
let delay = Double(index) * 0.2
line.moveX(-200).duration(2).delay(delay)
.then().moveX(200).makeColor(UIColor.purple).easing(.linear).repeatCount(100).autoreverses().duration(2).animate()
line.makeWidth(80).delay(delay).duration(1).autoreverses().easing(.linear).repeatCount(100).animate()
.then().moveX(200).makeColor(UIColor.purple).easing(.linear).repeatCount(100).reverses().duration(2).animate()
line.makeWidth(80).delay(delay).duration(1).reverses().easing(.linear).repeatCount(100).animate()
}


Expand Down
34 changes: 17 additions & 17 deletions StellarDemo/StellarDemo/Example8ViewController.swift
Expand Up @@ -17,13 +17,13 @@ class Example8ViewController: UIViewController {

switch index {
case 0:
animateView.moveX(200).duration(1.0).easing(.default).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.default).reverses().animate()
case 1:
animateView.moveX(200).duration(1.0).easing(.easeIn).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.easeIn).reverses().animate()
case 2:
animateView.moveX(200).duration(1.0).easing(.easeOut).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.easeOut).reverses().animate()
case 3:
animateView.moveX(200).duration(1.0).easing(.easeInEaseOut).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.easeInEaseOut).reverses().animate()
default:
print("")
}
Expand All @@ -35,13 +35,13 @@ class Example8ViewController: UIViewController {

switch index {
case 0:
animateView.moveX(200).duration(1.0).easing(.linear).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.linear).reverses().animate()
case 1:
animateView.moveX(200).duration(1.0).easing(.swiftOut).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.swiftOut).reverses().animate()
case 2:
animateView.moveX(200).duration(1.0).easing(.backEaseIn).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.backEaseIn).reverses().animate()
case 3:
animateView.moveX(200).duration(1.0).easing(.backEaseOut).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.backEaseOut).reverses().animate()
default:
print("")
}
Expand All @@ -53,13 +53,13 @@ class Example8ViewController: UIViewController {

switch index {
case 0:
animateView.moveX(200).duration(1.0).easing(.backEaseInOut).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.backEaseInOut).reverses().animate()
case 1:
animateView.moveX(200).duration(1.0).easing(.bounceOut).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.bounceOut).reverses().animate()
case 2:
animateView.moveX(200).duration(1.0).easing(.sine).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.sine).reverses().animate()
case 3:
animateView.moveX(200).duration(1.0).easing(.circ).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.circ).reverses().animate()
default:
print("")
}
Expand All @@ -72,13 +72,13 @@ class Example8ViewController: UIViewController {

switch index {
case 0:
animateView.moveX(200).duration(1.0).easing(.exponentialIn).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.exponentialIn).reverses().animate()
case 1:
animateView.moveX(200).duration(1.0).easing(.exponentialOut).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.exponentialOut).reverses().animate()
case 2:
animateView.moveX(200).duration(1.0).easing(.elasticIn).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.elasticIn).reverses().animate()
case 3:
animateView.moveX(200).duration(1.0).easing(.elasticOut).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.elasticOut).reverses().animate()
default:
print("")
}
Expand All @@ -91,7 +91,7 @@ class Example8ViewController: UIViewController {

switch index {
case 0:
animateView.moveX(200).duration(1.0).easing(.bounceReverse).autoreverses().animate()
animateView.moveX(200).duration(1.0).easing(.bounceReverse).reverses().animate()
case 1:
100.0.animate(to: 200, duration: 1.0, delay: 0.0, type: .swiftOut, autoreverses: false, repeatCount: 0, render: { (d) in
print("current value is \(d)")
Expand Down
Expand Up @@ -12,7 +12,7 @@ public protocol BasicConfigurable: BasicChainable {
func duration(_ d: CFTimeInterval) -> BasicConfigurable
func easing(_ type: TimingFunctionType) -> BasicConfigurable
func delay(_ d: CFTimeInterval) -> BasicConfigurable
func autoreverses() -> BasicConfigurable
func reverses() -> BasicConfigurable
func repeatCount(_ count: Int) -> BasicConfigurable
}

Expand All @@ -21,6 +21,6 @@ public protocol BasicConfigurable1: BasicChainable1 {
func duration(_ d: CFTimeInterval) -> BasicConfigurable1
func easing(_ type: TimingFunctionType) -> BasicConfigurable1
func delay(_ d: CFTimeInterval) -> BasicConfigurable1
func autoreverses() -> BasicConfigurable1
func reverses() -> BasicConfigurable1
func repeatCount(_ count: Int) -> BasicConfigurable1
}

0 comments on commit 8b76462

Please sign in to comment.