diff --git a/Sources/AttachmentConfigurable.swift b/Sources/AttachmentConfigurable.swift index f1de52a..d5c24b2 100755 --- a/Sources/AttachmentConfigurable.swift +++ b/Sources/AttachmentConfigurable.swift @@ -9,9 +9,5 @@ import UIKit public protocol AttachmentConfigurable: BasicChainable { - func attachment(_ damping: CGFloat, frequency: CGFloat) -> AttachmentConfigurable -} - -public protocol AttachmentConfigurable1: BasicChainable1 { - func attachment(_ damping: CGFloat, frequency: CGFloat) -> AttachmentConfigurable1 + func attachment(_ damping: CGFloat, frequency: CGFloat) -> Self } diff --git a/Sources/BasicChainable.swift b/Sources/BasicChainable.swift index 57d405c..8056d49 100755 --- a/Sources/BasicChainable.swift +++ b/Sources/BasicChainable.swift @@ -9,61 +9,32 @@ import UIKit public protocol BasicChainable: Chainable { - func moveX(_ increment: CGFloat) -> UIView - func moveY(_ increment: CGFloat) -> UIView - func moveTo(_ point: CGPoint) -> UIView - func makeColor(_ color: UIColor) -> UIView - func makeAlpha(_ alpha: CGFloat) -> UIView - func rotate(_ z: CGFloat) -> UIView - func rotateX(_ x: CGFloat) -> UIView - func rotateY(_ y: CGFloat) -> UIView - func rotateXY(_ xy: CGFloat) -> UIView - func makeWidth(_ width: CGFloat) -> UIView - func makeHeight(_ height: CGFloat) -> UIView - func makeSize(_ size: CGSize) -> UIView - func makeFrame(_ frame: CGRect) -> UIView - func makeBounds(_ bounds: CGRect) -> UIView - func scaleX(_ x: CGFloat) -> UIView - func scaleY(_ y: CGFloat) -> UIView - func scaleXY(_ x: CGFloat, _ y: CGFloat) -> UIView - func cornerRadius(_ radius: CGFloat) -> UIView - func borderWidth(_ width: CGFloat) -> UIView - func shadowRadius(_ radius: CGFloat) -> UIView - func zPosition(_ position: CGFloat) -> UIView - func anchorPoint(_ point: CGPoint) -> UIView - func anchorPointZ(_ z: CGFloat) -> UIView - func shadowOffset(_ offset: CGSize) -> UIView - func shadowColor(_ color: UIColor) -> UIView - func shadowOpacity(_ opacity: Float) -> UIView - func makeTintColor(_ color: UIColor) -> UIView - func completion(_ c: @escaping () -> Void) -> UIView -} - -//CALayer -public protocol BasicChainable1: Chainable1 { - func moveTo(_ point: CGPoint) -> CALayer - func makeColor(_ color: UIColor) -> CALayer - func makeOpacity(_ opacity: Float) -> CALayer - func rotate(_ z: CGFloat) -> CALayer - func rotateX(_ x: CGFloat) -> CALayer - func rotateY(_ y: CGFloat) -> CALayer - func rotateXY(_ xy: CGFloat) -> CALayer - func makeWidth(_ width: CGFloat) -> CALayer - func makeHeight(_ height: CGFloat) -> CALayer - func makeSize(_ size: CGSize) -> CALayer - func makeFrame(_ frame: CGRect) -> CALayer - func makeBounds(_ bounds: CGRect) -> CALayer - func scaleX(_ x: CGFloat) -> CALayer - func scaleY(_ y: CGFloat) -> CALayer - func scaleXY(_ x: CGFloat, _ y: CGFloat) -> CALayer - func cornerRadius(_ radius: CGFloat) -> CALayer - func borderWidth(_ width: CGFloat) -> CALayer - func shadowRadius(_ radius: CGFloat) -> CALayer - func zPosition(_ position: CGFloat) -> CALayer - func anchorPoint(_ point: CGPoint) -> CALayer - func anchorPointZ(_ z: CGFloat) -> CALayer - func shadowOffset(_ offset: CGSize) -> CALayer - func shadowColor(_ color: UIColor) -> CALayer - func shadowOpacity(_ opacity: Float) -> CALayer - func completion(_ c: @escaping () -> Void) -> CALayer +// func moveX(_ increment: CGFloat) -> Self +// func moveY(_ increment: CGFloat) -> Self + func moveTo(_ point: CGPoint) -> Self + func makeColor(_ color: UIColor) -> Self +// func makeAlpha(_ alpha: CGFloat) -> Self + func rotate(_ z: CGFloat) -> Self + func rotateX(_ x: CGFloat) -> Self + func rotateY(_ y: CGFloat) -> Self + func rotateXY(_ xy: CGFloat) -> Self + func makeWidth(_ width: CGFloat) -> Self + func makeHeight(_ height: CGFloat) -> Self + func makeSize(_ size: CGSize) -> Self + func makeFrame(_ frame: CGRect) -> Self + func makeBounds(_ bounds: CGRect) -> Self + func scaleX(_ x: CGFloat) -> Self + func scaleY(_ y: CGFloat) -> Self + func scaleXY(_ x: CGFloat, _ y: CGFloat) -> Self + func cornerRadius(_ radius: CGFloat) -> Self + func borderWidth(_ width: CGFloat) -> Self + func shadowRadius(_ radius: CGFloat) -> Self + func zPosition(_ position: CGFloat) -> Self + func anchorPoint(_ point: CGPoint) -> Self + func anchorPointZ(_ z: CGFloat) -> Self + func shadowOffset(_ offset: CGSize) -> Self + func shadowColor(_ color: UIColor) -> Self + func shadowOpacity(_ opacity: Float) -> Self + func makeTintColor(_ color: UIColor) -> Self + func completion(_ c: @escaping () -> Void) -> Self } diff --git a/Sources/BasicConfigurable.swift b/Sources/BasicConfigurable.swift index f0080c4..6db13cc 100755 --- a/Sources/BasicConfigurable.swift +++ b/Sources/BasicConfigurable.swift @@ -9,18 +9,9 @@ import UIKit public protocol BasicConfigurable: BasicChainable { - func duration(_ d: CFTimeInterval) -> BasicConfigurable - func easing(_ type: TimingFunctionType) -> BasicConfigurable - func delay(_ d: CFTimeInterval) -> BasicConfigurable - func autoreverses() -> BasicConfigurable - func repeatCount(_ count: Int) -> BasicConfigurable -} - -//CALayer -public protocol BasicConfigurable1: BasicChainable1 { - func duration(_ d: CFTimeInterval) -> BasicConfigurable1 - func easing(_ type: TimingFunctionType) -> BasicConfigurable1 - func delay(_ d: CFTimeInterval) -> BasicConfigurable1 - func autoreverses() -> BasicConfigurable1 - func repeatCount(_ count: Int) -> BasicConfigurable1 + func duration(_ d: CFTimeInterval) -> Self + func easing(_ type: TimingFunctionType) -> Self + func delay(_ d: CFTimeInterval) -> Self + func autoreverses() -> Self + func repeatCount(_ count: Int) -> Self } diff --git a/Sources/CALayer+Stellar.swift b/Sources/CALayer+Stellar.swift index 259ddae..e4eb452 100755 --- a/Sources/CALayer+Stellar.swift +++ b/Sources/CALayer+Stellar.swift @@ -8,160 +8,160 @@ import UIKit -extension CALayer: BasicConfigurable1, SnapConfigurable1, AttachmentConfigurable1, GravityConfigurable1, StepControllable { +extension CALayer: BasicConfigurable, SnapConfigurable, AttachmentConfigurable, GravityConfigurable, StepControllable { //MARK: animation methods - public func moveTo(_ point: CGPoint) -> CALayer { + public func moveTo(_ point: CGPoint) -> Self { let type = AnimationType(type: .basic, subType: .moveTo(point)) context.addAnimationType(type) return self } - public func makeColor(_ color: UIColor) -> CALayer { + public func makeColor(_ color: UIColor) -> Self { let type = AnimationType(type: .basic, subType: .color(color)) context.addAnimationType(type) return self } - public func makeOpacity(_ opacity: Float) -> CALayer { + public func makeOpacity(_ opacity: Float) -> Self { let type = AnimationType(type: .basic, subType: .opacity(opacity)) context.addAnimationType(type) return self } - public func rotate(_ z: CGFloat) -> CALayer { + public func rotate(_ z: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .rotate(z)) context.addAnimationType(type) return self } - public func rotateX(_ x: CGFloat) -> CALayer { + public func rotateX(_ x: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .rotateX(x)) context.addAnimationType(type) return self } - public func rotateY(_ y: CGFloat) -> CALayer { + public func rotateY(_ y: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .rotateY(y)) context.addAnimationType(type) return self } - public func rotateXY(_ xy: CGFloat) -> CALayer { + public func rotateXY(_ xy: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .rotateXY(xy)) context.addAnimationType(type) return self } - public func makeWidth(_ width: CGFloat) -> CALayer { + public func makeWidth(_ width: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .width(width)) context.addAnimationType(type) return self } - public func makeHeight(_ height: CGFloat) -> CALayer { + public func makeHeight(_ height: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .height(height)) context.addAnimationType(type) return self } - public func makeSize(_ size: CGSize) -> CALayer { + public func makeSize(_ size: CGSize) -> Self { let type = AnimationType(type: .basic, subType: .size(size)) context.addAnimationType(type) return self } - public func makeFrame(_ frame: CGRect) -> CALayer { + public func makeFrame(_ frame: CGRect) -> Self { let type = AnimationType(type: .basic, subType: .frame(frame)) context.addAnimationType(type) return self } - public func makeBounds(_ bounds: CGRect) -> CALayer { + public func makeBounds(_ bounds: CGRect) -> Self { let type = AnimationType(type: .basic, subType: .bounds(bounds)) context.addAnimationType(type) return self } - public func scaleX(_ x: CGFloat) -> CALayer { + public func scaleX(_ x: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .scaleX(x)) context.addAnimationType(type) return self } - public func scaleY(_ y: CGFloat) -> CALayer { + public func scaleY(_ y: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .scaleY(y)) context.addAnimationType(type) return self } - public func scaleXY(_ x: CGFloat, _ y: CGFloat) -> CALayer { + public func scaleXY(_ x: CGFloat, _ y: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .scaleXY(x,y)) context.addAnimationType(type) return self } - public func cornerRadius(_ radius: CGFloat) -> CALayer { + public func cornerRadius(_ radius: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .cornerRadius(radius)) context.addAnimationType(type) return self } - public func borderWidth(_ width: CGFloat) -> CALayer { + public func borderWidth(_ width: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .borderWidth(width)) context.addAnimationType(type) return self } - public func shadowRadius(_ radius: CGFloat) -> CALayer { + public func shadowRadius(_ radius: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .shadowRadius(radius)) context.addAnimationType(type) return self } - public func zPosition(_ position: CGFloat) -> CALayer { + public func zPosition(_ position: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .zPosition(position)) context.addAnimationType(type) return self } - public func anchorPoint(_ point: CGPoint) -> CALayer { + public func anchorPoint(_ point: CGPoint) -> Self { let type = AnimationType(type: .basic, subType: .anchorPoint(point)) context.addAnimationType(type) return self } - public func anchorPointZ(_ z: CGFloat) -> CALayer { + public func anchorPointZ(_ z: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .anchorPointZ(z)) context.addAnimationType(type) return self } - public func shadowOffset(_ offset: CGSize) -> CALayer { + public func shadowOffset(_ offset: CGSize) -> Self { let type = AnimationType(type: .basic, subType: .shadowOffset(offset)) context.addAnimationType(type) return self } - public func shadowColor(_ color: UIColor) -> CALayer { + public func shadowColor(_ color: UIColor) -> Self { let type = AnimationType(type: .basic, subType: .shadowColor(color)) context.addAnimationType(type) return self } - public func shadowOpacity(_ opacity: Float) -> CALayer { + public func shadowOpacity(_ opacity: Float) -> Self { let type = AnimationType(type: .basic, subType: .shadowOpacity(opacity)) context.addAnimationType(type) return self } - public func makeTintColor(_ color: UIColor) -> CALayer { + public func makeTintColor(_ color: UIColor) -> Self { let type = AnimationType(type: .basic, subType: .tintColor(color)) context.addAnimationType(type) return self } - public func completion(_ c: @escaping () -> Void) -> CALayer { + public func completion(_ c: @escaping () -> Void) -> Self { context.changeCompletion(c) return self } @@ -169,52 +169,52 @@ extension CALayer: BasicConfigurable1, SnapConfigurable1, AttachmentConfigurable //MARK: Physical Animation //Snap - public func snap(_ damping: CGFloat = 0.5) -> SnapConfigurable1 { + public func snap(_ damping: CGFloat = 0.5) -> Self { context.changeMainType(.snap(damping)) return self } //Attachment - public func attachment(_ damping: CGFloat = 0.5, frequency: CGFloat = 0.5) -> AttachmentConfigurable1 { + public func attachment(_ damping: CGFloat = 0.5, frequency: CGFloat = 0.5) -> Self { context.changeMainType(.attachment(damping, frequency)) return self } //Gravity - public func gravity(_ magnitude: Double = 1.0) -> GravityConfigurable1 { + public func gravity(_ magnitude: Double = 1.0) -> Self { context.changeMainType(.gravity(magnitude)) return self } //MARK: Basic Animation configurations - public func duration(_ d: CFTimeInterval) -> BasicConfigurable1 { + public func duration(_ d: CFTimeInterval) -> Self { context.changeDuration(d) return self } - public func easing(_ type: TimingFunctionType) -> BasicConfigurable1 { + public func easing(_ type: TimingFunctionType) -> Self { context.changeEasing(type) return self } - public func delay(_ d: CFTimeInterval) -> BasicConfigurable1 { + public func delay(_ d: CFTimeInterval) -> Self { context.changeDelay(d) return self } - public func autoreverses() -> BasicConfigurable1 { + public func autoreverses() -> Self { context.changeAutoreverses(true) return self } - public func repeatCount(_ count: Int) -> BasicConfigurable1 { + public func repeatCount(_ count: Int) -> Self { context.changeRepeatCount(count) return self } //MARK: Chainable methods - public func then() -> CALayer { + public func then() -> Self { context.makeNextStep() return self } diff --git a/Sources/Chainable.swift b/Sources/Chainable.swift index 9780a14..52079c8 100755 --- a/Sources/Chainable.swift +++ b/Sources/Chainable.swift @@ -10,13 +10,6 @@ import UIKit public protocol Chainable { //Chainable methods - func then() -> UIView - func animate() -> Void -} - -//CALayer -public protocol Chainable1 { - //Chainable methods - func then() -> CALayer + func then() -> Self func animate() -> Void } diff --git a/Sources/GravityConfigurable.swift b/Sources/GravityConfigurable.swift index bb0ccf6..0f057d0 100755 --- a/Sources/GravityConfigurable.swift +++ b/Sources/GravityConfigurable.swift @@ -9,9 +9,5 @@ import UIKit public protocol GravityConfigurable: BasicChainable { - func gravity(_ magnitude: Double) -> GravityConfigurable -} - -public protocol GravityConfigurable1: BasicChainable1 { - func gravity(_ magnitude: Double) -> GravityConfigurable1 + func gravity(_ magnitude: Double) -> Self } diff --git a/Sources/SnapConfigurable.swift b/Sources/SnapConfigurable.swift index 483c8c4..78b3174 100755 --- a/Sources/SnapConfigurable.swift +++ b/Sources/SnapConfigurable.swift @@ -9,9 +9,5 @@ import UIKit public protocol SnapConfigurable: BasicChainable { - func snap(_ damping: CGFloat) -> SnapConfigurable -} - -public protocol SnapConfigurable1: BasicChainable1 { - func snap(_ damping: CGFloat) -> SnapConfigurable1 + func snap(_ damping: CGFloat) -> Self } diff --git a/Sources/UIView+Stellar.swift b/Sources/UIView+Stellar.swift index 91fcd85..5a5d77c 100755 --- a/Sources/UIView+Stellar.swift +++ b/Sources/UIView+Stellar.swift @@ -18,169 +18,169 @@ public enum AnimationStyle { extension UIView: BasicConfigurable, SnapConfigurable, AttachmentConfigurable, GravityConfigurable, StepControllable { //MARK: animation methods - public func moveX(_ increment: CGFloat) -> UIView { + public func moveX(_ increment: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .moveX(increment)) context.addAnimationType(type) return self } - public func moveY(_ increment: CGFloat) -> UIView { + public func moveY(_ increment: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .moveY(increment)) context.addAnimationType(type) return self } - public func moveTo(_ point: CGPoint) -> UIView { + public func moveTo(_ point: CGPoint) -> Self { let type = AnimationType(type: .basic, subType: .moveTo(point)) context.addAnimationType(type) return self } - public func makeColor(_ color: UIColor) -> UIView { + public func makeColor(_ color: UIColor) -> Self { let type = AnimationType(type: .basic, subType: .color(color)) context.addAnimationType(type) return self } - public func makeAlpha(_ alpha: CGFloat) -> UIView { + public func makeAlpha(_ alpha: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .alpha(alpha)) context.addAnimationType(type) return self } - public func rotate(_ z: CGFloat) -> UIView { + public func rotate(_ z: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .rotate(z)) context.addAnimationType(type) return self } - public func rotateX(_ x: CGFloat) -> UIView { + public func rotateX(_ x: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .rotateX(x)) context.addAnimationType(type) return self } - public func rotateY(_ y: CGFloat) -> UIView { + public func rotateY(_ y: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .rotateY(y)) context.addAnimationType(type) return self } - public func rotateXY(_ xy: CGFloat) -> UIView { + public func rotateXY(_ xy: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .rotateXY(xy)) context.addAnimationType(type) return self } - public func makeWidth(_ width: CGFloat) -> UIView { + public func makeWidth(_ width: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .width(width)) context.addAnimationType(type) return self } - public func makeHeight(_ height: CGFloat) -> UIView { + public func makeHeight(_ height: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .height(height)) context.addAnimationType(type) return self } - public func makeSize(_ size: CGSize) -> UIView { + public func makeSize(_ size: CGSize) -> Self { let type = AnimationType(type: .basic, subType: .size(size)) context.addAnimationType(type) return self } - public func makeFrame(_ frame: CGRect) -> UIView { + public func makeFrame(_ frame: CGRect) -> Self { let type = AnimationType(type: .basic, subType: .frame(frame)) context.addAnimationType(type) return self } - public func makeBounds(_ bounds: CGRect) -> UIView { + public func makeBounds(_ bounds: CGRect) -> Self { let type = AnimationType(type: .basic, subType: .bounds(bounds)) context.addAnimationType(type) return self } - public func scaleX(_ x: CGFloat) -> UIView { + public func scaleX(_ x: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .scaleX(x)) context.addAnimationType(type) return self } - public func scaleY(_ y: CGFloat) -> UIView { + public func scaleY(_ y: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .scaleY(y)) context.addAnimationType(type) return self } - public func scaleXY(_ x: CGFloat, _ y: CGFloat) -> UIView { + public func scaleXY(_ x: CGFloat, _ y: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .scaleXY(x,y)) context.addAnimationType(type) return self } - public func cornerRadius(_ radius: CGFloat) -> UIView { + public func cornerRadius(_ radius: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .cornerRadius(radius)) context.addAnimationType(type) return self } - public func borderWidth(_ width: CGFloat) -> UIView { + public func borderWidth(_ width: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .borderWidth(width)) context.addAnimationType(type) return self } - public func shadowRadius(_ radius: CGFloat) -> UIView { + public func shadowRadius(_ radius: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .shadowRadius(radius)) context.addAnimationType(type) return self } - public func zPosition(_ position: CGFloat) -> UIView { + public func zPosition(_ position: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .zPosition(position)) context.addAnimationType(type) return self } - public func anchorPoint(_ point: CGPoint) -> UIView { + public func anchorPoint(_ point: CGPoint) -> Self { let type = AnimationType(type: .basic, subType: .anchorPoint(point)) context.addAnimationType(type) return self } - public func anchorPointZ(_ z: CGFloat) -> UIView { + public func anchorPointZ(_ z: CGFloat) -> Self { let type = AnimationType(type: .basic, subType: .anchorPointZ(z)) context.addAnimationType(type) return self } - public func shadowOffset(_ offset: CGSize) -> UIView { + public func shadowOffset(_ offset: CGSize) -> Self { let type = AnimationType(type: .basic, subType: .shadowOffset(offset)) context.addAnimationType(type) return self } - public func shadowColor(_ color: UIColor) -> UIView { + public func shadowColor(_ color: UIColor) -> Self { let type = AnimationType(type: .basic, subType: .shadowColor(color)) context.addAnimationType(type) return self } - public func shadowOpacity(_ opacity: Float) -> UIView { + public func shadowOpacity(_ opacity: Float) -> Self { let type = AnimationType(type: .basic, subType: .shadowOpacity(opacity)) context.addAnimationType(type) return self } - public func makeTintColor(_ color: UIColor) -> UIView { + public func makeTintColor(_ color: UIColor) -> Self { let type = AnimationType(type: .basic, subType: .tintColor(color)) context.addAnimationType(type) return self } - public func completion(_ c: @escaping () -> Void) -> UIView { + public func completion(_ c: @escaping () -> Void) -> Self { context.changeCompletion(c) return self } @@ -188,52 +188,52 @@ extension UIView: BasicConfigurable, SnapConfigurable, AttachmentConfigurable, G //MARK: Physical Animation //Snap - public func snap(_ damping: CGFloat = 0.5) -> SnapConfigurable { + public func snap(_ damping: CGFloat = 0.5) -> Self { context.changeMainType(.snap(damping)) return self } //Attachment - public func attachment(_ damping: CGFloat = 0.5, frequency: CGFloat = 0.5) -> AttachmentConfigurable { + public func attachment(_ damping: CGFloat = 0.5, frequency: CGFloat = 0.5) -> Self { context.changeMainType(.attachment(damping, frequency)) return self } //Gravity - public func gravity(_ magnitude: Double = 1.0) -> GravityConfigurable { + public func gravity(_ magnitude: Double = 1.0) -> Self { context.changeMainType(.gravity(magnitude)) return self } //MARK: Basic Animation configurations - public func duration(_ d: CFTimeInterval) -> BasicConfigurable { + public func duration(_ d: CFTimeInterval) -> Self { context.changeDuration(d) return self } - public func easing(_ type: TimingFunctionType) -> BasicConfigurable { + public func easing(_ type: TimingFunctionType) -> Self { context.changeEasing(type) return self } - public func delay(_ d: CFTimeInterval) -> BasicConfigurable { + public func delay(_ d: CFTimeInterval) -> Self { context.changeDelay(d) return self } - public func autoreverses() -> BasicConfigurable { + public func autoreverses() -> Self { context.changeAutoreverses(true) return self } - public func repeatCount(_ count: Int) -> BasicConfigurable { + public func repeatCount(_ count: Int) -> Self { context.changeRepeatCount(count) return self } //MARK: Chainable methods - public func then() -> UIView { + public func then() -> Self { context.makeNextStep() return self }