diff --git a/DKChainableAnimationKit.podspec b/DKChainableAnimationKit.podspec index 67fd05e..304608a 100644 --- a/DKChainableAnimationKit.podspec +++ b/DKChainableAnimationKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "DKChainableAnimationKit" - s.version = "1.5.0" + s.version = "1.6.0" s.summary = "Chainable Animation in Swift" s.description = <<-DESC diff --git a/DKChainableAnimationKit.xcodeproj/project.pbxproj b/DKChainableAnimationKit.xcodeproj/project.pbxproj index a3c2ce5..32f6c3c 100644 --- a/DKChainableAnimationKit.xcodeproj/project.pbxproj +++ b/DKChainableAnimationKit.xcodeproj/project.pbxproj @@ -196,7 +196,9 @@ 5287D66B1B1120E6006A9A84 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0630; + LastSwiftMigration = 0700; + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = DeltaX; TargetAttributes = { 5287D6731B1120E6006A9A84 = { @@ -301,6 +303,7 @@ CURRENT_PROJECT_VERSION = 1.3; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -378,6 +381,7 @@ INFOPLIST_FILE = DKChainableAnimationKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.draveness.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; @@ -393,6 +397,7 @@ INFOPLIST_FILE = DKChainableAnimationKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.draveness.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; }; @@ -411,6 +416,7 @@ ); INFOPLIST_FILE = DKChainableAnimationKitTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.draveness.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -424,6 +430,7 @@ ); INFOPLIST_FILE = DKChainableAnimationKitTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.draveness.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/DKChainableAnimationKit.xcodeproj/xcshareddata/xcschemes/DKChainableAnimationKit.xcscheme b/DKChainableAnimationKit.xcodeproj/xcshareddata/xcschemes/DKChainableAnimationKit.xcscheme index 457dc10..360190e 100644 --- a/DKChainableAnimationKit.xcodeproj/xcshareddata/xcschemes/DKChainableAnimationKit.xcscheme +++ b/DKChainableAnimationKit.xcodeproj/xcshareddata/xcschemes/DKChainableAnimationKit.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,15 +62,18 @@ ReferencedContainer = "container:DKChainableAnimationKit.xcodeproj"> + + DKChainableAnimationKit { self.addAnimationCalculationAction { (view: UIView) -> Void in let borderColorAnimation = self.basicAnimationForKeyPath("borderColor") - borderColorAnimation.fromValue = UIColor(CGColor: view.layer.borderColor) + borderColorAnimation.fromValue = UIColor(CGColor: view.layer.borderColor!) borderColorAnimation.toValue = color self.addAnimationFromCalculationBlock(borderColorAnimation) } diff --git a/DKChainableAnimationKit/Classes/DKChainableAnimationKit+Frame.swift b/DKChainableAnimationKit/Classes/DKChainableAnimationKit+Frame.swift index 2c192fd..1fac92b 100644 --- a/DKChainableAnimationKit/Classes/DKChainableAnimationKit+Frame.swift +++ b/DKChainableAnimationKit/Classes/DKChainableAnimationKit+Frame.swift @@ -11,12 +11,11 @@ import Foundation public extension DKChainableAnimationKit { public func makeFrame(rect: CGRect) -> DKChainableAnimationKit { - return self.makeOrigin(rect.origin.x, rect.origin.y).makeBounds(rect) + return self.makeOrigin(rect.origin).makeSize(rect.size) } public func makeFrame(x: CGFloat, _ y: CGFloat, _ width: CGFloat, _ height: CGFloat) -> DKChainableAnimationKit { - let rect = CGRect(x: x, y: y, width: width, height: height) - return self.makeOrigin(x, y).makeBounds(rect) + return self.makeFrame(CGRect(x: x, y: y, width: width, height: height)) } public func makeBounds(rect: CGRect) -> DKChainableAnimationKit { @@ -28,6 +27,10 @@ public extension DKChainableAnimationKit { } + public func makeSize(size: CGSize) -> DKChainableAnimationKit { + return self.makeSize(size.width, size.height) + } + public func makeSize(width: CGFloat, _ height: CGFloat) -> DKChainableAnimationKit { self.addAnimationCalculationAction { (view: UIView) -> Void in @@ -38,13 +41,17 @@ public extension DKChainableAnimationKit { } self.addAnimationCompletionAction { (view: UIView) -> Void in - var bounds = CGRect(x: 0, y: 0, width: width, height: height) - view.layer.bounds = bounds - view.bounds = bounds + view.layer.bounds.size = CGSize(width: width, height: height) + view.bounds.size = CGSize(width: width, height: height) } return self } + public func makeOrigin(origin: CGPoint) -> DKChainableAnimationKit { + return self.makeOrigin(origin.x, origin.y) + + } + public func makeOrigin(x: CGFloat, _ y: CGFloat) -> DKChainableAnimationKit { self.addAnimationCalculationAction { (view: UIView) -> Void in let positionAnimation = self.basicAnimationForKeyPath("position") @@ -59,7 +66,10 @@ public extension DKChainableAnimationKit { view.layer.position = newPosition } return self + } + public func makeCenter(center: CGPoint) -> DKChainableAnimationKit { + return self.makeCenter(center.x, center.y) } public func makeCenter(x: CGFloat, _ y: CGFloat) -> DKChainableAnimationKit { diff --git a/DKChainableAnimationKit/Classes/DKChainableAnimationKit+Transform.swift b/DKChainableAnimationKit/Classes/DKChainableAnimationKit+Transform.swift index 1056062..9619043 100644 --- a/DKChainableAnimationKit/Classes/DKChainableAnimationKit+Transform.swift +++ b/DKChainableAnimationKit/Classes/DKChainableAnimationKit+Transform.swift @@ -99,14 +99,14 @@ extension DKChainableAnimationKit { self.addAnimationCalculationAction { (view: UIView) -> Void in let transformAnimation = self.basicAnimationForKeyPath("transform") var transform = view.layer.transform - transform = CATransform3DTranslate(transform, scale, scale, 1) + transform = CATransform3DScale(transform, scale, scale, 1) transformAnimation.fromValue = NSValue(CATransform3D: view.layer.transform) transformAnimation.toValue = NSValue(CATransform3D: transform) self.addAnimationFromCalculationBlock(transformAnimation) } self.addAnimationCompletionAction { (view: UIView) -> Void in var transform = view.layer.transform - transform = CATransform3DTranslate(transform, scale, scale, 1) + transform = CATransform3DScale(transform, scale, scale, 1) view.layer.transform = transform } return self @@ -116,14 +116,14 @@ extension DKChainableAnimationKit { self.addAnimationCalculationAction { (view: UIView) -> Void in let transformAnimation = self.basicAnimationForKeyPath("transform") var transform = view.layer.transform - transform = CATransform3DTranslate(transform, scaleX, 1, 1) + transform = CATransform3DScale(transform, scaleX, 1, 1) transformAnimation.fromValue = NSValue(CATransform3D: view.layer.transform) transformAnimation.toValue = NSValue(CATransform3D: transform) self.addAnimationFromCalculationBlock(transformAnimation) } self.addAnimationCompletionAction { (view: UIView) -> Void in var transform = view.layer.transform - transform = CATransform3DTranslate(transform, scaleX, 1, 1) + transform = CATransform3DScale(transform, scaleX, 1, 1) view.layer.transform = transform } return self @@ -133,14 +133,14 @@ extension DKChainableAnimationKit { self.addAnimationCalculationAction { (view: UIView) -> Void in let transformAnimation = self.basicAnimationForKeyPath("transform") var transform = view.layer.transform - transform = CATransform3DTranslate(transform, 1, scaleY, 1) + transform = CATransform3DScale(transform, 1, scaleY, 1) transformAnimation.fromValue = NSValue(CATransform3D: view.layer.transform) transformAnimation.toValue = NSValue(CATransform3D: transform) self.addAnimationFromCalculationBlock(transformAnimation) } self.addAnimationCompletionAction { (view: UIView) -> Void in var transform = view.layer.transform - transform = CATransform3DTranslate(transform, 1, scaleY, 1) + transform = CATransform3DScale(transform, 1, scaleY, 1) view.layer.transform = transform } return self diff --git a/DKChainableAnimationKit/Classes/DKChainableAnimationKit.swift b/DKChainableAnimationKit/Classes/DKChainableAnimationKit.swift index ee4376c..4550b03 100644 --- a/DKChainableAnimationKit/Classes/DKChainableAnimationKit.swift +++ b/DKChainableAnimationKit/Classes/DKChainableAnimationKit.swift @@ -267,14 +267,14 @@ public class DKChainableAnimationKit { return animation } - internal func newPositionFrom(#newOrigin: CGPoint) -> CGPoint { + internal func newPositionFrom(newOrigin newOrigin: CGPoint) -> CGPoint { let anchor = self.view.layer.anchorPoint let size = self.view.bounds.size let newPosition = CGPoint(x: newOrigin.x + anchor.x * size.width, y: newOrigin.y + anchor.y * size.height) return newPosition } - internal func newPositionFrom(#newCenter: CGPoint) -> CGPoint { + internal func newPositionFrom(newCenter newCenter: CGPoint) -> CGPoint { let anchor = self.view.layer.anchorPoint let size = self.view.bounds.size let newPosition = CGPoint(x: newCenter.x + (anchor.x - 0.5) * size.width, y: newCenter.y + (anchor.y - 0.5) * size.height) diff --git a/DKChainableAnimationKit/Classes/DKKeyFrameAnimation.swift b/DKChainableAnimationKit/Classes/DKKeyFrameAnimation.swift index 52469a0..351cb50 100644 --- a/DKChainableAnimationKit/Classes/DKKeyFrameAnimation.swift +++ b/DKChainableAnimationKit/Classes/DKKeyFrameAnimation.swift @@ -33,10 +33,18 @@ public class DKKeyFrameAnimation: CAKeyframeAnimation { if valueIsKindOf(NSNumber) { self.values = self.valueArrayFor(startValue: CGFloat(fromValue.floatValue), endValue: CGFloat(toValue.floatValue)) as [AnyObject] } else if valueIsKindOf(UIColor) { - let fromColor = self.fromValue.CGColor - let toColor = self.toValue.CGColor - let fromComponents = CGColorGetComponents(fromColor) - let toComponents = CGColorGetComponents(toColor) + var fromColor = self.fromValue + var toColor = self.toValue + if CGColorGetNumberOfComponents(fromColor.CGColor) == 2 { + let fromComponents = CGColorGetComponents(fromColor.CGColor) + fromColor = UIColor(red: fromComponents[0], green: fromComponents[0], blue: fromComponents[0], alpha: fromComponents[1]) + } + if CGColorGetNumberOfComponents(toColor.CGColor) == 2 { + let toComponents = CGColorGetComponents(toColor.CGColor) + toColor = UIColor(red: toComponents[0], green: toComponents[0], blue: toComponents[0], alpha: toComponents[1]) + } + let fromComponents = CGColorGetComponents(fromColor.CGColor) + let toComponents = CGColorGetComponents(toColor.CGColor) let redValues = self.valueArrayFor(startValue: fromComponents[0], endValue: toComponents[0]) as! [CGFloat] let greenValues = self.valueArrayFor(startValue: fromComponents[1], endValue: toComponents[1]) as! [CGFloat] @@ -48,8 +56,8 @@ public class DKKeyFrameAnimation: CAKeyframeAnimation { self.fromValue.objCType let valueType: NSString! = NSString(CString: self.fromValue.objCType, encoding: 1) if valueType.containsString("CGRect") { - let fromRect = self.fromValue.CGRectValue() - let toRect = self.toValue.CGRectValue() + let fromRect = self.fromValue.CGRectValue + let toRect = self.toValue.CGRectValue let xValues = self.valueArrayFor(startValue: fromRect.origin.x, endValue: toRect.origin.x) as! [CGFloat] let yValues = self.valueArrayFor(startValue: fromRect.origin.y, endValue: toRect.origin.x) as! [CGFloat] @@ -59,8 +67,8 @@ public class DKKeyFrameAnimation: CAKeyframeAnimation { self.values = self.rectArrayFrom(xValues: xValues, yValues: yValues, widthValues: widthValues, heightValues: heightValues) as [AnyObject] } else if valueType.containsString("CGPoint") { - let fromPoint = self.fromValue.CGPointValue() - let toPoint = self.toValue.CGPointValue() + let fromPoint = self.fromValue.CGPointValue + let toPoint = self.toValue.CGPointValue let path = self.createPathFromXYValues(self.valueArrayFor(startValue: fromPoint.x, endValue: toPoint.x), yValues: self.valueArrayFor(startValue: fromPoint.y, endValue: toPoint.y)) self.path = path } else if valueType.containsString("CGSize") { @@ -101,12 +109,12 @@ public class DKKeyFrameAnimation: CAKeyframeAnimation { } private func createTransformArrayFrom( - #m11: NSArray, m12: NSArray, m13: NSArray, m14: NSArray, + m11 m11: NSArray, m12: NSArray, m13: NSArray, m14: NSArray, m21: NSArray, m22: NSArray, m23: NSArray, m24: NSArray, m31: NSArray, m32: NSArray, m33: NSArray, m34: NSArray, m41: NSArray, m42: NSArray, m43: NSArray, m44: NSArray) -> NSArray { let numberOfTransforms = m11.count; - var values = NSMutableArray(capacity: numberOfTransforms) + let values = NSMutableArray(capacity: numberOfTransforms) var value: CATransform3D! for (var i = 1; i < numberOfTransforms; i++) { value = CATransform3DIdentity; @@ -155,9 +163,9 @@ public class DKKeyFrameAnimation: CAKeyframeAnimation { return self.fromValue.isKindOfClass(klass) && self.toValue.isKindOfClass(klass) } - private func rectArrayFrom(#xValues: [CGFloat], yValues: [CGFloat], widthValues: [CGFloat], heightValues: [CGFloat]) -> NSArray { + private func rectArrayFrom(xValues xValues: [CGFloat], yValues: [CGFloat], widthValues: [CGFloat], heightValues: [CGFloat]) -> NSArray { let numberOfRects = xValues.count - var values: NSMutableArray = [] + let values: NSMutableArray = [] var value: NSValue for i in 1.. [CGColor] { + private func colorArrayFrom(redValues redValues: [CGFloat], greenValues: [CGFloat], blueValues: [CGFloat], alphaValues: [CGFloat]) -> [CGColor] { let numberOfColors = redValues.count var values: [CGColor] = [] var value: CGColor! @@ -180,7 +188,7 @@ public class DKKeyFrameAnimation: CAKeyframeAnimation { return values } - private func valueArrayFor(#startValue: CGFloat, endValue: CGFloat) -> NSArray { + private func valueArrayFor(startValue startValue: CGFloat, endValue: CGFloat) -> NSArray { let startValue = Double(startValue) let endValue = Double(endValue) @@ -192,7 +200,7 @@ public class DKKeyFrameAnimation: CAKeyframeAnimation { var valueArray: [Double] = [] - for i in 0.. Double { +func DKKeyframeAnimationFunctionEaseInSine(t: Double, b: Double, c: Double, d: Double) -> Double { return -c * cos(t / d * (M_PI_2)) + c + b; } -func DKKeyframeAnimationFunctionEaseOutSine(var t: Double, b: Double, c: Double, d: Double) -> Double { +func DKKeyframeAnimationFunctionEaseOutSine(t: Double, b: Double, c: Double, d: Double) -> Double { return c * sin(t / d * (M_PI_2)) + b; } -func DKKeyframeAnimationFunctionEaseInOutSine(var t: Double, b: Double, c: Double, d: Double) -> Double { +func DKKeyframeAnimationFunctionEaseInOutSine(t: Double, b: Double, c: Double, d: Double) -> Double { return -c / 2 * (cos(M_PI * t / d) - 1) + b; } -func DKKeyframeAnimationFunctionEaseInExpo(var t: Double, b: Double, c: Double, d: Double) -> Double { +func DKKeyframeAnimationFunctionEaseInExpo(t: Double, b: Double, c: Double, d: Double) -> Double { return (t==0) ? b : c * pow(2, 10 * (t / d - 1)) + b; } -func DKKeyframeAnimationFunctionEaseOutExpo(var t: Double, b: Double, c: Double, d: Double) -> Double { +func DKKeyframeAnimationFunctionEaseOutExpo(t: Double, b: Double, c: Double, d: Double) -> Double { return (t == d) ? b+c : c * (-pow(2, -10 * t / d) + 1) + b; } @@ -252,8 +252,8 @@ func DKKeyframeAnimationFunctionEaseInOutBack(var t: Double, b: Double, c: Doubl } } -func DKKeyframeAnimationFunctionEaseInBounce(var t: Double, b: Double, c: Double, d: Double) -> Double { - return c - DKKeyframeAnimationFunctionEaseOutBounce(d - t, 0, c, d) + b; +func DKKeyframeAnimationFunctionEaseInBounce(t: Double, b: Double, c: Double, d: Double) -> Double { + return c - DKKeyframeAnimationFunctionEaseOutBounce(d - t, b: 0, c: c, d: d) + b; } func DKKeyframeAnimationFunctionEaseOutBounce(var t: Double, b: Double, c: Double, d: Double) -> Double { @@ -272,10 +272,10 @@ func DKKeyframeAnimationFunctionEaseOutBounce(var t: Double, b: Double, c: Doubl } } -func DKKeyframeAnimationFunctionEaseInOutBounce(var t: Double, b: Double, c: Double, d: Double) -> Double { +func DKKeyframeAnimationFunctionEaseInOutBounce(t: Double, b: Double, c: Double, d: Double) -> Double { if t < d / 2 { - return DKKeyframeAnimationFunctionEaseInBounce (t * 2, 0, c, d) * 0.5 + b; + return DKKeyframeAnimationFunctionEaseInBounce (t * 2, b: 0, c: c, d: d) * 0.5 + b; } else { - return DKKeyframeAnimationFunctionEaseOutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; + return DKKeyframeAnimationFunctionEaseOutBounce(t * 2 - d, b: 0, c: c, d: d) * 0.5 + c * 0.5 + b; } } \ No newline at end of file diff --git a/DKChainableAnimationKit/Classes/UIView+AnimationKit.swift b/DKChainableAnimationKit/Classes/UIView+AnimationKit.swift index 760f2d2..97a9ee1 100644 --- a/DKChainableAnimationKit/Classes/UIView+AnimationKit.swift +++ b/DKChainableAnimationKit/Classes/UIView+AnimationKit.swift @@ -20,7 +20,7 @@ public extension UIView { } else { animation = DKChainableAnimationKit() animation.view = self - objc_setAssociatedObject(self, &animationKitAssociationKey, animation, objc_AssociationPolicy(OBJC_ASSOCIATION_RETAIN)) + objc_setAssociatedObject(self, &animationKitAssociationKey, animation, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) return animation } } diff --git a/DKChainableAnimationKit/Info.plist b/DKChainableAnimationKit/Info.plist index 567726f..0e600e6 100644 --- a/DKChainableAnimationKit/Info.plist +++ b/DKChainableAnimationKit/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.draveness.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/DKChainableAnimationKitTests/Info.plist b/DKChainableAnimationKitTests/Info.plist index fb981fb..ba72822 100644 --- a/DKChainableAnimationKitTests/Info.plist +++ b/DKChainableAnimationKitTests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.draveness.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/README.md b/README.md index ac57100..12dae89 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ This is a swift port for JHChainableAnimations by [jhurray](https://github.com/j # Demo -![language](https://img.shields.io/badge/Language-%20Swift%20-orange.svg) -![Version](https://img.shields.io/badge/Pod-%20v1.3.0%20-or.svg) +![language](https://img.shields.io/badge/Language-%20Swift 2.0%20-orange.svg) +[![Version](http://img.shields.io/cocoapods/v/DKChainableAnimationKit.svg?style=flat)](http://cocoadocs.org/docsets/DKChainableAnimationKit) ![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg) ![MIT License](https://img.shields.io/github/license/mashape/apistatus.svg) ![Platform](https://img.shields.io/badge/platform-%20iOS%20-lightgrey.svg) @@ -51,7 +51,7 @@ view.animation.makeScale(2.0).spring.animate(1.0) ``` use_frameworks! -pod "DKChainableAnimationKit", "~> 1.5.0" +pod "DKChainableAnimationKit", "~> 1.6.0" ``` # Installation with Carthage @@ -385,10 +385,13 @@ Animation effects does not work on path movement. +# Swift 2.0 + +If you would like to use this repo with Swift 2.0, checkout `swift-2.0` branch. + # To Do * Support OS X -* Support Swift 2.0 ---- diff --git a/iOS Example Tests/Info.plist b/iOS Example Tests/Info.plist index fb981fb..ba72822 100644 --- a/iOS Example Tests/Info.plist +++ b/iOS Example Tests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.draveness.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/iOS Example.xcodeproj/project.pbxproj b/iOS Example.xcodeproj/project.pbxproj index 2d3322c..401e73c 100644 --- a/iOS Example.xcodeproj/project.pbxproj +++ b/iOS Example.xcodeproj/project.pbxproj @@ -207,7 +207,8 @@ 18CEB5B41B059B0300B6ACCB /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0630; + LastSwiftUpdateCheck = 0710; + LastUpgradeCheck = 0710; ORGANIZATIONNAME = DeltaX; TargetAttributes = { 18CEB5BB1B059B0300B6ACCB = { @@ -355,6 +356,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -422,6 +424,7 @@ FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "iOS Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.draveness.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "iOS Example"; }; name = Debug; @@ -433,6 +436,7 @@ FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = "iOS Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.draveness.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "iOS Example"; }; name = Release; @@ -451,6 +455,7 @@ ); INFOPLIST_FILE = "iOS Example Tests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.draveness.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "iOS ExampleTests"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS Example.app/iOS Example"; }; @@ -466,6 +471,7 @@ ); INFOPLIST_FILE = "iOS Example Tests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.draveness.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "iOS ExampleTests"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOS Example.app/iOS Example"; }; diff --git a/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme index 4ca0326..1384a93 100644 --- a/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ b/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -38,15 +38,18 @@ ReferencedContainer = "container:iOS Example.xcodeproj"> + + @@ -62,10 +65,10 @@ diff --git a/iOS Example/Base.lproj/Main.storyboard b/iOS Example/Base.lproj/Main.storyboard index 52ea29e..751e6de 100644 --- a/iOS Example/Base.lproj/Main.storyboard +++ b/iOS Example/Base.lproj/Main.storyboard @@ -1,13 +1,14 @@ - + - + + - + @@ -15,6 +16,7 @@ + diff --git a/iOS Example/Info.plist b/iOS Example/Info.plist index a30eb3e..9f9e6e8 100644 --- a/iOS Example/Info.plist +++ b/iOS Example/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.draveness.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/iOS Example/ViewController.swift b/iOS Example/ViewController.swift index b64b3b6..4d86ad4 100644 --- a/iOS Example/ViewController.swift +++ b/iOS Example/ViewController.swift @@ -11,7 +11,7 @@ import DKChainableAnimationKit class ViewController: UIViewController { - let v: UIView = UIView(frame: CGRect(x: 100, y: 150, width: 50, height: 50)) + let v: UIView = UIView(frame: CGRect(x: 10, y: 60, width: 50, height: 50)) override func viewDidLoad() { super.viewDidLoad() @@ -32,12 +32,11 @@ class ViewController: UIViewController { func animateView(sender: UIButton) { sender.userInteractionEnabled = false - let purple = UIColor.purpleColor() let green = UIColor.greenColor() - v.animation.moveX(100).thenAfter(1.0).moveWidth(50).bounce.makeBackground(green).easeIn.anchorTopLeft.thenAfter(0.5).rotate(95).easeBack.thenAfter(0.5).moveY(300).easeIn.makeOpacity(0.0).animateWithCompletion(0.4, { + v.animation.anchorTopLeft.moveX(100).easeInOutExpo.thenAfter(0.5).moveWidth(50).bounce.makeBackground(green).easeIn.anchorTopLeft.thenAfter(0.5).rotate(95).easeBack.thenAfter(0.5).moveY(300).easeIn.makeOpacity(0.0).animateWithCompletion(0.4, { self.v.layer.transform = CATransform3DMakeRotation(0, 0, 0, 1) - self.v.frame = CGRectMake(100, 150, 50, 50) + self.v.frame = CGRectMake(10, 60, 50, 50) self.v.animation.makeOpacity(1.0).makeBackground(UIColor.blueColor()).animate(1.0) self.v.layer.cornerRadius = 0