From 6bfac9e63a9185177a424956916c359edbc154a7 Mon Sep 17 00:00:00 2001 From: Keith Ito Date: Tue, 19 Apr 2016 20:39:28 -0400 Subject: [PATCH] Add basic animations. --- Example/Podfile.lock | 2 +- .../SimpleAnimation.xcodeproj/project.pbxproj | 1733 ++++++----------- .../SimpleAnimation-Example.xcscheme | 2 +- Example/SimpleAnimation/AppDelegate.swift | 37 +- .../Base.lproj/LaunchScreen.xib | 28 +- .../Base.lproj/Main.storyboard | 66 +- .../Images.xcassets/Contents.json | 6 + .../play.imageset/Contents.json | 22 + .../play.imageset/play_24x24@2x.png | Bin 0 -> 770 bytes .../play.imageset/play_24x24@3x.png | Bin 0 -> 1063 bytes Example/SimpleAnimation/ViewController.swift | 180 +- SimpleAnimation/Classes/ReplaceMe.swift | 0 .../Classes/UIView+SimpleAnimation.swift | 230 +++ 13 files changed, 1084 insertions(+), 1222 deletions(-) create mode 100644 Example/SimpleAnimation/Images.xcassets/Contents.json create mode 100644 Example/SimpleAnimation/Images.xcassets/play.imageset/Contents.json create mode 100644 Example/SimpleAnimation/Images.xcassets/play.imageset/play_24x24@2x.png create mode 100644 Example/SimpleAnimation/Images.xcassets/play.imageset/play_24x24@3x.png delete mode 100644 SimpleAnimation/Classes/ReplaceMe.swift create mode 100644 SimpleAnimation/Classes/UIView+SimpleAnimation.swift diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 2a69936..0578de1 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -15,6 +15,6 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Nimble: 703854335d181df169bbca9c97117b5cf8c47c1d Quick: 18d057bc66451eedd5d1c8dc99ba2a5db6e60226 - SimpleAnimation: 9a631c1c29d93b9b5585a75fbf064e55dfaa6e5c + SimpleAnimation: dfdeddaf49c2e41f49651345a6fb81184e212373 COCOAPODS: 0.39.0 diff --git a/Example/SimpleAnimation.xcodeproj/project.pbxproj b/Example/SimpleAnimation.xcodeproj/project.pbxproj index e7e1fea..bde0f62 100644 --- a/Example/SimpleAnimation.xcodeproj/project.pbxproj +++ b/Example/SimpleAnimation.xcodeproj/project.pbxproj @@ -1,1151 +1,582 @@ - - - - - archiveVersion - 1 - classes - - objectVersion - 46 - objects - - 0C144004CF3CDA22BB2F5AAC - - includeInIndex - 1 - isa - PBXFileReference - name - README.md - path - ../README.md - sourceTree - <group> - - 0D1C1D5675070D0F8B51E49F - - children - - A8DDD23EC4A4DF11B1A88262 - 5E43733D922790CFDF1CEEE2 - - isa - PBXGroup - name - Frameworks - sourceTree - <group> - - 3434EFCF4260B2E87ED70539 - - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Copy Pods Resources - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - "${SRCROOT}/Pods/Target Support Files/Pods-SimpleAnimation_Example/Pods-SimpleAnimation_Example-resources.sh" - - showEnvVarsInLog - 0 - - 43A8E55717C8842068E1F844 - - fileRef - A8DDD23EC4A4DF11B1A88262 - isa - PBXBuildFile - - 43F595BA5EB0C5C68D068703 - - fileRef - 5E43733D922790CFDF1CEEE2 - isa - PBXBuildFile - - 46B23AF0A6FE32C7F4453201 - - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Check Pods Manifest.lock - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null -if [[ $? != 0 ]] ; then - cat << EOM -error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. -EOM - exit 1 -fi - - showEnvVarsInLog - 0 - - 5833BB20FA3860F21BAC8A97 - - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Copy Pods Resources - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - "${SRCROOT}/Pods/Target Support Files/Pods-SimpleAnimation_Tests/Pods-SimpleAnimation_Tests-resources.sh" - - showEnvVarsInLog - 0 - - 5C0F7DB46DE73B6374D3B4B3 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods-SimpleAnimation_Example.debug.xcconfig - path - Pods/Target Support Files/Pods-SimpleAnimation_Example/Pods-SimpleAnimation_Example.debug.xcconfig - sourceTree - <group> - - 5D42D7B405384C4D8697FF38 - - includeInIndex - 1 - isa - PBXFileReference - name - LICENSE - path - ../LICENSE - sourceTree - <group> - - 5E43733D922790CFDF1CEEE2 - - explicitFileType - wrapper.framework - includeInIndex - 0 - isa - PBXFileReference - path - Pods_SimpleAnimation_Tests.framework - sourceTree - BUILT_PRODUCTS_DIR - - 607FACC71AFB9204008FA782 - - children - - 607FACF51AFB993E008FA782 - 607FACD21AFB9204008FA782 - 607FACE81AFB9204008FA782 - 607FACD11AFB9204008FA782 - B069D7CFC01302F5E2F8BFA1 - 0D1C1D5675070D0F8B51E49F - - isa - PBXGroup - sourceTree - <group> - - 607FACC81AFB9204008FA782 - - attributes - - LastSwiftUpdateCheck - 0720 - LastUpgradeCheck - 0720 - ORGANIZATIONNAME - CocoaPods - TargetAttributes - - 607FACCF1AFB9204008FA782 - - CreatedOnToolsVersion - 6.3.1 - - 607FACE41AFB9204008FA782 - - CreatedOnToolsVersion - 6.3.1 - TestTargetID - 607FACCF1AFB9204008FA782 - - - - buildConfigurationList - 607FACCB1AFB9204008FA782 - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - Base - - mainGroup - 607FACC71AFB9204008FA782 - productRefGroup - 607FACD11AFB9204008FA782 - projectDirPath - - projectReferences - - projectRoot - - targets - - 607FACCF1AFB9204008FA782 - 607FACE41AFB9204008FA782 - - - 607FACCB1AFB9204008FA782 - - buildConfigurations - - 607FACED1AFB9204008FA782 - 607FACEE1AFB9204008FA782 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 607FACCC1AFB9204008FA782 - - buildActionMask - 2147483647 - files - - 607FACD81AFB9204008FA782 - 607FACD61AFB9204008FA782 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 607FACCD1AFB9204008FA782 - - buildActionMask - 2147483647 - files - - 43A8E55717C8842068E1F844 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 607FACCE1AFB9204008FA782 - - buildActionMask - 2147483647 - files - - 607FACDB1AFB9204008FA782 - 607FACE01AFB9204008FA782 - 607FACDD1AFB9204008FA782 - - isa - PBXResourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 607FACCF1AFB9204008FA782 - - buildConfigurationList - 607FACEF1AFB9204008FA782 - buildPhases - - A2C5B6CD04FE7639918D4D85 - 607FACCC1AFB9204008FA782 - 607FACCD1AFB9204008FA782 - 607FACCE1AFB9204008FA782 - 7193325D905A102A4ADF3A59 - 3434EFCF4260B2E87ED70539 - - buildRules - - dependencies - - isa - PBXNativeTarget - name - SimpleAnimation_Example - productName - SimpleAnimation - productReference - 607FACD01AFB9204008FA782 - productType - com.apple.product-type.application - - 607FACD01AFB9204008FA782 - - explicitFileType - wrapper.application - includeInIndex - 0 - isa - PBXFileReference - path - SimpleAnimation_Example.app - sourceTree - BUILT_PRODUCTS_DIR - - 607FACD11AFB9204008FA782 - - children - - 607FACD01AFB9204008FA782 - 607FACE51AFB9204008FA782 - - isa - PBXGroup - name - Products - sourceTree - <group> - - 607FACD21AFB9204008FA782 - - children - - 607FACD51AFB9204008FA782 - 607FACD71AFB9204008FA782 - 607FACD91AFB9204008FA782 - 607FACDC1AFB9204008FA782 - 607FACDE1AFB9204008FA782 - 607FACD31AFB9204008FA782 - - isa - PBXGroup - name - Example for SimpleAnimation - path - SimpleAnimation - sourceTree - <group> - - 607FACD31AFB9204008FA782 - - children - - 607FACD41AFB9204008FA782 - - isa - PBXGroup - name - Supporting Files - sourceTree - <group> - - 607FACD41AFB9204008FA782 - - isa - PBXFileReference - lastKnownFileType - text.plist.xml - path - Info.plist - sourceTree - <group> - - 607FACD51AFB9204008FA782 - - isa - PBXFileReference - lastKnownFileType - sourcecode.swift - path - AppDelegate.swift - sourceTree - <group> - - 607FACD61AFB9204008FA782 - - fileRef - 607FACD51AFB9204008FA782 - isa - PBXBuildFile - - 607FACD71AFB9204008FA782 - - isa - PBXFileReference - lastKnownFileType - sourcecode.swift - path - ViewController.swift - sourceTree - <group> - - 607FACD81AFB9204008FA782 - - fileRef - 607FACD71AFB9204008FA782 - isa - PBXBuildFile - - 607FACD91AFB9204008FA782 - - children - - 607FACDA1AFB9204008FA782 - - isa - PBXVariantGroup - name - Main.storyboard - sourceTree - <group> - - 607FACDA1AFB9204008FA782 - - isa - PBXFileReference - lastKnownFileType - file.storyboard - name - Base - path - Base.lproj/Main.storyboard - sourceTree - <group> - - 607FACDB1AFB9204008FA782 - - fileRef - 607FACD91AFB9204008FA782 - isa - PBXBuildFile - - 607FACDC1AFB9204008FA782 - - isa - PBXFileReference - lastKnownFileType - folder.assetcatalog - path - Images.xcassets - sourceTree - <group> - - 607FACDD1AFB9204008FA782 - - fileRef - 607FACDC1AFB9204008FA782 - isa - PBXBuildFile - - 607FACDE1AFB9204008FA782 - - children - - 607FACDF1AFB9204008FA782 - - isa - PBXVariantGroup - name - LaunchScreen.xib - sourceTree - <group> - - 607FACDF1AFB9204008FA782 - - isa - PBXFileReference - lastKnownFileType - file.xib - name - Base - path - Base.lproj/LaunchScreen.xib - sourceTree - <group> - - 607FACE01AFB9204008FA782 - - fileRef - 607FACDE1AFB9204008FA782 - isa - PBXBuildFile - - 607FACE11AFB9204008FA782 - - buildActionMask - 2147483647 - files - - 607FACEC1AFB9204008FA782 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 607FACE21AFB9204008FA782 - - buildActionMask - 2147483647 - files - - 43F595BA5EB0C5C68D068703 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 607FACE31AFB9204008FA782 - - buildActionMask - 2147483647 - files - - isa - PBXResourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 607FACE41AFB9204008FA782 - - buildConfigurationList - 607FACF21AFB9204008FA782 - buildPhases - - 46B23AF0A6FE32C7F4453201 - 607FACE11AFB9204008FA782 - 607FACE21AFB9204008FA782 - 607FACE31AFB9204008FA782 - 68BE24EAE6F9C3C98ECC5AC3 - 5833BB20FA3860F21BAC8A97 - - buildRules - - dependencies - - 607FACE71AFB9204008FA782 - - isa - PBXNativeTarget - name - SimpleAnimation_Tests - productName - Tests - productReference - 607FACE51AFB9204008FA782 - productType - com.apple.product-type.bundle.unit-test - - 607FACE51AFB9204008FA782 - - explicitFileType - wrapper.cfbundle - includeInIndex - 0 - isa - PBXFileReference - path - SimpleAnimation_Tests.xctest - sourceTree - BUILT_PRODUCTS_DIR - - 607FACE61AFB9204008FA782 - - containerPortal - 607FACC81AFB9204008FA782 - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - 607FACCF1AFB9204008FA782 - remoteInfo - SimpleAnimation - - 607FACE71AFB9204008FA782 - - isa - PBXTargetDependency - target - 607FACCF1AFB9204008FA782 - targetProxy - 607FACE61AFB9204008FA782 - - 607FACE81AFB9204008FA782 - - children - - 607FACEB1AFB9204008FA782 - 607FACE91AFB9204008FA782 - - isa - PBXGroup - path - Tests - sourceTree - <group> - - 607FACE91AFB9204008FA782 - - children - - 607FACEA1AFB9204008FA782 - - isa - PBXGroup - name - Supporting Files - sourceTree - <group> - - 607FACEA1AFB9204008FA782 - - isa - PBXFileReference - lastKnownFileType - text.plist.xml - path - Info.plist - sourceTree - <group> - - 607FACEB1AFB9204008FA782 - - isa - PBXFileReference - lastKnownFileType - sourcecode.swift - path - Tests.swift - sourceTree - <group> - - 607FACEC1AFB9204008FA782 - - fileRef - 607FACEB1AFB9204008FA782 - isa - PBXBuildFile - - 607FACED1AFB9204008FA782 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES_ERROR - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES_ERROR - CLANG_WARN_UNREACHABLE_CODE - YES - CLANG_WARN__DUPLICATE_METHOD_MATCH - YES - CODE_SIGN_IDENTITY[sdk=iphoneos*] - iPhone Developer - 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 - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES_ERROR - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES_AGGRESSIVE - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 8.3 - MTL_ENABLE_DEBUG_INFO - YES - ONLY_ACTIVE_ARCH - YES - SDKROOT - iphoneos - SWIFT_OPTIMIZATION_LEVEL - -Onone - - isa - XCBuildConfiguration - name - Debug - - 607FACEE1AFB9204008FA782 - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES_ERROR - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES_ERROR - CLANG_WARN_UNREACHABLE_CODE - YES - CLANG_WARN__DUPLICATE_METHOD_MATCH - YES - CODE_SIGN_IDENTITY[sdk=iphoneos*] - iPhone Developer - COPY_PHASE_STRIP - NO - DEBUG_INFORMATION_FORMAT - dwarf-with-dsym - ENABLE_NS_ASSERTIONS - NO - ENABLE_STRICT_OBJC_MSGSEND - YES - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_NO_COMMON_BLOCKS - YES - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES_ERROR - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES_AGGRESSIVE - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 8.3 - MTL_ENABLE_DEBUG_INFO - NO - SDKROOT - iphoneos - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 607FACEF1AFB9204008FA782 - - buildConfigurations - - 607FACF01AFB9204008FA782 - 607FACF11AFB9204008FA782 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 607FACF01AFB9204008FA782 - - baseConfigurationReference - 5C0F7DB46DE73B6374D3B4B3 - buildSettings - - ASSETCATALOG_COMPILER_APPICON_NAME - AppIcon - INFOPLIST_FILE - SimpleAnimation/Info.plist - LD_RUNPATH_SEARCH_PATHS - $(inherited) @executable_path/Frameworks - MODULE_NAME - ExampleApp - PRODUCT_BUNDLE_IDENTIFIER - org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier) - PRODUCT_NAME - $(TARGET_NAME) - - isa - XCBuildConfiguration - name - Debug - - 607FACF11AFB9204008FA782 - - baseConfigurationReference - 9C8613934360B43B511E1CEE - buildSettings - - ASSETCATALOG_COMPILER_APPICON_NAME - AppIcon - INFOPLIST_FILE - SimpleAnimation/Info.plist - LD_RUNPATH_SEARCH_PATHS - $(inherited) @executable_path/Frameworks - MODULE_NAME - ExampleApp - PRODUCT_BUNDLE_IDENTIFIER - org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier) - PRODUCT_NAME - $(TARGET_NAME) - - isa - XCBuildConfiguration - name - Release - - 607FACF21AFB9204008FA782 - - buildConfigurations - - 607FACF31AFB9204008FA782 - 607FACF41AFB9204008FA782 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 607FACF31AFB9204008FA782 - - baseConfigurationReference - C06A04970CFB7433270A23AC - buildSettings - - FRAMEWORK_SEARCH_PATHS - - $(SDKROOT)/Developer/Library/Frameworks - $(inherited) - - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - INFOPLIST_FILE - Tests/Info.plist - LD_RUNPATH_SEARCH_PATHS - $(inherited) @executable_path/Frameworks @loader_path/Frameworks - PRODUCT_BUNDLE_IDENTIFIER - org.cocoapods.$(PRODUCT_NAME:rfc1034identifier) - PRODUCT_NAME - $(TARGET_NAME) - - isa - XCBuildConfiguration - name - Debug - - 607FACF41AFB9204008FA782 - - baseConfigurationReference - 6225F3B2713E047D44E51CCF - buildSettings - - FRAMEWORK_SEARCH_PATHS - - $(SDKROOT)/Developer/Library/Frameworks - $(inherited) - - INFOPLIST_FILE - Tests/Info.plist - LD_RUNPATH_SEARCH_PATHS - $(inherited) @executable_path/Frameworks @loader_path/Frameworks - PRODUCT_BUNDLE_IDENTIFIER - org.cocoapods.$(PRODUCT_NAME:rfc1034identifier) - PRODUCT_NAME - $(TARGET_NAME) - - isa - XCBuildConfiguration - name - Release - - 607FACF51AFB993E008FA782 - - children - - 63B84BD05E1E9A2BCEFA3CD1 - 0C144004CF3CDA22BB2F5AAC - 5D42D7B405384C4D8697FF38 - - isa - PBXGroup - name - Podspec Metadata - sourceTree - <group> - - 6225F3B2713E047D44E51CCF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods-SimpleAnimation_Tests.release.xcconfig - path - Pods/Target Support Files/Pods-SimpleAnimation_Tests/Pods-SimpleAnimation_Tests.release.xcconfig - sourceTree - <group> - - 63B84BD05E1E9A2BCEFA3CD1 - - includeInIndex - 1 - isa - PBXFileReference - name - SimpleAnimation.podspec - path - ../SimpleAnimation.podspec - sourceTree - <group> - - 68BE24EAE6F9C3C98ECC5AC3 - - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Embed Pods Frameworks - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - "${SRCROOT}/Pods/Target Support Files/Pods-SimpleAnimation_Tests/Pods-SimpleAnimation_Tests-frameworks.sh" - - showEnvVarsInLog - 0 - - 7193325D905A102A4ADF3A59 - - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Embed Pods Frameworks - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - "${SRCROOT}/Pods/Target Support Files/Pods-SimpleAnimation_Example/Pods-SimpleAnimation_Example-frameworks.sh" - - showEnvVarsInLog - 0 - - 9C8613934360B43B511E1CEE - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods-SimpleAnimation_Example.release.xcconfig - path - Pods/Target Support Files/Pods-SimpleAnimation_Example/Pods-SimpleAnimation_Example.release.xcconfig - sourceTree - <group> - - A2C5B6CD04FE7639918D4D85 - - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Check Pods Manifest.lock - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null -if [[ $? != 0 ]] ; then - cat << EOM -error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. -EOM - exit 1 -fi - - showEnvVarsInLog - 0 - - A8DDD23EC4A4DF11B1A88262 - - explicitFileType - wrapper.framework - includeInIndex - 0 - isa - PBXFileReference - path - Pods_SimpleAnimation_Example.framework - sourceTree - BUILT_PRODUCTS_DIR - - B069D7CFC01302F5E2F8BFA1 - - children - - 5C0F7DB46DE73B6374D3B4B3 - 9C8613934360B43B511E1CEE - C06A04970CFB7433270A23AC - 6225F3B2713E047D44E51CCF - - isa - PBXGroup - name - Pods - sourceTree - <group> - - C06A04970CFB7433270A23AC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods-SimpleAnimation_Tests.debug.xcconfig - path - Pods/Target Support Files/Pods-SimpleAnimation_Tests/Pods-SimpleAnimation_Tests.debug.xcconfig - sourceTree - <group> - - - rootObject - 607FACC81AFB9204008FA782 - - +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 43A8E55717C8842068E1F844 /* Pods_SimpleAnimation_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A8DDD23EC4A4DF11B1A88262 /* Pods_SimpleAnimation_Example.framework */; }; + 43F595BA5EB0C5C68D068703 /* Pods_SimpleAnimation_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E43733D922790CFDF1CEEE2 /* Pods_SimpleAnimation_Tests.framework */; }; + 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; + 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; + 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; + 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; + 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; + 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 607FACC81AFB9204008FA782 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 607FACCF1AFB9204008FA782; + remoteInfo = SimpleAnimation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0C144004CF3CDA22BB2F5AAC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + 5C0F7DB46DE73B6374D3B4B3 /* Pods-SimpleAnimation_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleAnimation_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleAnimation_Example/Pods-SimpleAnimation_Example.debug.xcconfig"; sourceTree = ""; }; + 5D42D7B405384C4D8697FF38 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; + 5E43733D922790CFDF1CEEE2 /* Pods_SimpleAnimation_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SimpleAnimation_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 607FACD01AFB9204008FA782 /* SimpleAnimation_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleAnimation_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 607FACE51AFB9204008FA782 /* SimpleAnimation_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SimpleAnimation_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; + 6225F3B2713E047D44E51CCF /* Pods-SimpleAnimation_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleAnimation_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleAnimation_Tests/Pods-SimpleAnimation_Tests.release.xcconfig"; sourceTree = ""; }; + 63B84BD05E1E9A2BCEFA3CD1 /* SimpleAnimation.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SimpleAnimation.podspec; path = ../SimpleAnimation.podspec; sourceTree = ""; }; + 9C8613934360B43B511E1CEE /* Pods-SimpleAnimation_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleAnimation_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleAnimation_Example/Pods-SimpleAnimation_Example.release.xcconfig"; sourceTree = ""; }; + A8DDD23EC4A4DF11B1A88262 /* Pods_SimpleAnimation_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SimpleAnimation_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C06A04970CFB7433270A23AC /* Pods-SimpleAnimation_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleAnimation_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleAnimation_Tests/Pods-SimpleAnimation_Tests.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 607FACCD1AFB9204008FA782 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 43A8E55717C8842068E1F844 /* Pods_SimpleAnimation_Example.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 607FACE21AFB9204008FA782 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 43F595BA5EB0C5C68D068703 /* Pods_SimpleAnimation_Tests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0D1C1D5675070D0F8B51E49F /* Frameworks */ = { + isa = PBXGroup; + children = ( + A8DDD23EC4A4DF11B1A88262 /* Pods_SimpleAnimation_Example.framework */, + 5E43733D922790CFDF1CEEE2 /* Pods_SimpleAnimation_Tests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 607FACC71AFB9204008FA782 = { + isa = PBXGroup; + children = ( + 607FACF51AFB993E008FA782 /* Podspec Metadata */, + 607FACD21AFB9204008FA782 /* Example for SimpleAnimation */, + 607FACE81AFB9204008FA782 /* Tests */, + 607FACD11AFB9204008FA782 /* Products */, + B069D7CFC01302F5E2F8BFA1 /* Pods */, + 0D1C1D5675070D0F8B51E49F /* Frameworks */, + ); + sourceTree = ""; + }; + 607FACD11AFB9204008FA782 /* Products */ = { + isa = PBXGroup; + children = ( + 607FACD01AFB9204008FA782 /* SimpleAnimation_Example.app */, + 607FACE51AFB9204008FA782 /* SimpleAnimation_Tests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 607FACD21AFB9204008FA782 /* Example for SimpleAnimation */ = { + isa = PBXGroup; + children = ( + 607FACD51AFB9204008FA782 /* AppDelegate.swift */, + 607FACD71AFB9204008FA782 /* ViewController.swift */, + 607FACD91AFB9204008FA782 /* Main.storyboard */, + 607FACDC1AFB9204008FA782 /* Images.xcassets */, + 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, + 607FACD31AFB9204008FA782 /* Supporting Files */, + ); + name = "Example for SimpleAnimation"; + path = SimpleAnimation; + sourceTree = ""; + }; + 607FACD31AFB9204008FA782 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 607FACD41AFB9204008FA782 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 607FACE81AFB9204008FA782 /* Tests */ = { + isa = PBXGroup; + children = ( + 607FACEB1AFB9204008FA782 /* Tests.swift */, + 607FACE91AFB9204008FA782 /* Supporting Files */, + ); + path = Tests; + sourceTree = ""; + }; + 607FACE91AFB9204008FA782 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 607FACEA1AFB9204008FA782 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { + isa = PBXGroup; + children = ( + 63B84BD05E1E9A2BCEFA3CD1 /* SimpleAnimation.podspec */, + 0C144004CF3CDA22BB2F5AAC /* README.md */, + 5D42D7B405384C4D8697FF38 /* LICENSE */, + ); + name = "Podspec Metadata"; + sourceTree = ""; + }; + B069D7CFC01302F5E2F8BFA1 /* Pods */ = { + isa = PBXGroup; + children = ( + 5C0F7DB46DE73B6374D3B4B3 /* Pods-SimpleAnimation_Example.debug.xcconfig */, + 9C8613934360B43B511E1CEE /* Pods-SimpleAnimation_Example.release.xcconfig */, + C06A04970CFB7433270A23AC /* Pods-SimpleAnimation_Tests.debug.xcconfig */, + 6225F3B2713E047D44E51CCF /* Pods-SimpleAnimation_Tests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 607FACCF1AFB9204008FA782 /* SimpleAnimation_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SimpleAnimation_Example" */; + buildPhases = ( + A2C5B6CD04FE7639918D4D85 /* Check Pods Manifest.lock */, + 607FACCC1AFB9204008FA782 /* Sources */, + 607FACCD1AFB9204008FA782 /* Frameworks */, + 607FACCE1AFB9204008FA782 /* Resources */, + 7193325D905A102A4ADF3A59 /* Embed Pods Frameworks */, + 3434EFCF4260B2E87ED70539 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SimpleAnimation_Example; + productName = SimpleAnimation; + productReference = 607FACD01AFB9204008FA782 /* SimpleAnimation_Example.app */; + productType = "com.apple.product-type.application"; + }; + 607FACE41AFB9204008FA782 /* SimpleAnimation_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SimpleAnimation_Tests" */; + buildPhases = ( + 46B23AF0A6FE32C7F4453201 /* Check Pods Manifest.lock */, + 607FACE11AFB9204008FA782 /* Sources */, + 607FACE21AFB9204008FA782 /* Frameworks */, + 607FACE31AFB9204008FA782 /* Resources */, + 68BE24EAE6F9C3C98ECC5AC3 /* Embed Pods Frameworks */, + 5833BB20FA3860F21BAC8A97 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 607FACE71AFB9204008FA782 /* PBXTargetDependency */, + ); + name = SimpleAnimation_Tests; + productName = Tests; + productReference = 607FACE51AFB9204008FA782 /* SimpleAnimation_Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 607FACC81AFB9204008FA782 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = CocoaPods; + TargetAttributes = { + 607FACCF1AFB9204008FA782 = { + CreatedOnToolsVersion = 6.3.1; + }; + 607FACE41AFB9204008FA782 = { + CreatedOnToolsVersion = 6.3.1; + TestTargetID = 607FACCF1AFB9204008FA782; + }; + }; + }; + buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SimpleAnimation" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 607FACC71AFB9204008FA782; + productRefGroup = 607FACD11AFB9204008FA782 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 607FACCF1AFB9204008FA782 /* SimpleAnimation_Example */, + 607FACE41AFB9204008FA782 /* SimpleAnimation_Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 607FACCE1AFB9204008FA782 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, + 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, + 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 607FACE31AFB9204008FA782 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3434EFCF4260B2E87ED70539 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SimpleAnimation_Example/Pods-SimpleAnimation_Example-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 46B23AF0A6FE32C7F4453201 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 5833BB20FA3860F21BAC8A97 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SimpleAnimation_Tests/Pods-SimpleAnimation_Tests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 68BE24EAE6F9C3C98ECC5AC3 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SimpleAnimation_Tests/Pods-SimpleAnimation_Tests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 7193325D905A102A4ADF3A59 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SimpleAnimation_Example/Pods-SimpleAnimation_Example-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + A2C5B6CD04FE7639918D4D85 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 607FACCC1AFB9204008FA782 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, + 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 607FACE11AFB9204008FA782 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 607FACCF1AFB9204008FA782 /* SimpleAnimation_Example */; + targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 607FACD91AFB9204008FA782 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 607FACDA1AFB9204008FA782 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 607FACDF1AFB9204008FA782 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 607FACED1AFB9204008FA782 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + 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; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 607FACEE1AFB9204008FA782 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 607FACF01AFB9204008FA782 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5C0F7DB46DE73B6374D3B4B3 /* Pods-SimpleAnimation_Example.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SimpleAnimation/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MODULE_NAME = ExampleApp; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 607FACF11AFB9204008FA782 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9C8613934360B43B511E1CEE /* Pods-SimpleAnimation_Example.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SimpleAnimation/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MODULE_NAME = ExampleApp; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 607FACF31AFB9204008FA782 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C06A04970CFB7433270A23AC /* Pods-SimpleAnimation_Tests.debug.xcconfig */; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Tests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 607FACF41AFB9204008FA782 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6225F3B2713E047D44E51CCF /* Pods-SimpleAnimation_Tests.release.xcconfig */; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = Tests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "SimpleAnimation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 607FACED1AFB9204008FA782 /* Debug */, + 607FACEE1AFB9204008FA782 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SimpleAnimation_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 607FACF01AFB9204008FA782 /* Debug */, + 607FACF11AFB9204008FA782 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "SimpleAnimation_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 607FACF31AFB9204008FA782 /* Debug */, + 607FACF41AFB9204008FA782 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 607FACC81AFB9204008FA782 /* Project object */; +} diff --git a/Example/SimpleAnimation.xcodeproj/xcshareddata/xcschemes/SimpleAnimation-Example.xcscheme b/Example/SimpleAnimation.xcodeproj/xcshareddata/xcschemes/SimpleAnimation-Example.xcscheme index 1e2e94a..a69cfbb 100644 --- a/Example/SimpleAnimation.xcodeproj/xcshareddata/xcschemes/SimpleAnimation-Example.xcscheme +++ b/Example/SimpleAnimation.xcodeproj/xcshareddata/xcschemes/SimpleAnimation-Example.xcscheme @@ -1,6 +1,6 @@ Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - + func application(application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + return true + } } - diff --git a/Example/SimpleAnimation/Base.lproj/LaunchScreen.xib b/Example/SimpleAnimation/Base.lproj/LaunchScreen.xib index c204dc4..da074b6 100644 --- a/Example/SimpleAnimation/Base.lproj/LaunchScreen.xib +++ b/Example/SimpleAnimation/Base.lproj/LaunchScreen.xib @@ -1,8 +1,8 @@ - + - - + + @@ -10,29 +10,7 @@ - - - - - - - - - - - - diff --git a/Example/SimpleAnimation/Base.lproj/Main.storyboard b/Example/SimpleAnimation/Base.lproj/Main.storyboard index 52ea29e..aaefa3e 100644 --- a/Example/SimpleAnimation/Base.lproj/Main.storyboard +++ b/Example/SimpleAnimation/Base.lproj/Main.storyboard @@ -1,13 +1,14 @@ - + - + + - + @@ -15,11 +16,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/SimpleAnimation/Images.xcassets/Contents.json b/Example/SimpleAnimation/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Example/SimpleAnimation/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/SimpleAnimation/Images.xcassets/play.imageset/Contents.json b/Example/SimpleAnimation/Images.xcassets/play.imageset/Contents.json new file mode 100644 index 0000000..c7210ce --- /dev/null +++ b/Example/SimpleAnimation/Images.xcassets/play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "play_24x24@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "play_24x24@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/SimpleAnimation/Images.xcassets/play.imageset/play_24x24@2x.png b/Example/SimpleAnimation/Images.xcassets/play.imageset/play_24x24@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..7847fdb32773acc787078b3fc2bcde8332d5fea2 GIT binary patch literal 770 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tmUKs7M+SzC{oH>NS%G|oWRD45dJguM!v-tY$DUh!@P+6=(yLU`q0KcVYP7-hXC4kjGiz z5m^kh={g8AI%&+V01C2~c>21sKVT8&mlj-_=6sBSf$^)Si(^Q{;kVQG`Y}0*wA!DU zm9gkXlFoulE?&IS)wLXgi#|q9xVE2Z>&N9ER39)Nxsi26Vxi$i7GITvNje3NiRsVI zty}uMY_|3DGxw_Bz2W=wxc}k9ow^7urXbXxMZWbQ4#%WOM+*9XYFeqmg~dwSc^;)_>(%Wv+;Y0~-b)H&DS zSIfgQFF6m0ELUnwyP^0hTFkfRdG05@2`5;$B-b{Yo)lqvu2YzO_SI%ymZEE}jB=3= zFHL&fZ&xKWO~avan&R)wkOhx57(TOwm$pqlzBX4{v_VpD%g=iS{EHkv`S!;wVwKx+ zQ~u-Zm?@@}0gJ5L5BU_IWHoN<`L~3J80K09&3AsNxy_rY%Yrx&@NN?Bi%)41pC z)889ke1Dt#B(T>fe(GNab!D%RnbR(Ozn64=X5IC#-=>upgq*&2tKf22&tmbO(4#p% z#+Rm4T$^Mce91qTe^d4wqwF6#M&E0DYajMmh30kC_R6+>cKstCR>PRI?2%Y}>BQr} zG@)AJ8c~vxSdwa$T$Bo=7>o=I&2$Y+bPX*-3{9cp XtHiBg!Ljq)Kn)C@u6{1-oD!M<+w?&4 literal 0 HcmV?d00001 diff --git a/Example/SimpleAnimation/Images.xcassets/play.imageset/play_24x24@3x.png b/Example/SimpleAnimation/Images.xcassets/play.imageset/play_24x24@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..1e83aebf903a4501da73120af2ef40897644a6c9 GIT binary patch literal 1063 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhawSkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YDR+ueoXe|!I#{XiaP zfk$L9(5CAk%;=;sy8#Ag8!{cAkUeU~1| zzfxP?8)R2hvb%j{deDQJd*{tsa!>VK>b9OlujFp;yac|F2c(vn99yyRXlBwm$v!7T z_r<(^vr3m+a2?(CGwp&1<2k)a6Q^g%u%DK;XpWKU=5b%RL;vVb3C%vILdT}bNybGB ze1m>D_$wa|)R_0;(U%Aj&XXFiuI`wzphYiAY463CENm=nuh*PD^|N4sWaCa2gEQvb z3uYS3*`iS|#IR*k&O~?7R+TtLlaveh*IsaRvspc5qw_)aC$9hX1I;d*l>AhfBf^@j zknyycF`#it{fVmYEdgS?{F*NuefgO^Yx@Dl9|ud_eyGlQx^tEIinBr-33KeGxf-AQ zA^%IGr~c6KbAoc5Yu5Z=&b4M@+Ht6F+0#gU-`?`9Qe`&?%PL>Lrqx<{#veWlouL+&q@jp=f^BsXX?}4_x z*vmXeaMPBqG@YscKiqSC=Gyk{l?1<}*!imG^(WT-waC3<8MZ}!s!{%hbsz6CxPQFH z9k7$x#+WCxjk8bcEbq=op3Q3abwZXln6?Z0b2s`pZ?#@_IQE9VLHV3QZi&`K_A(l7 zVYlxrQuPa4|D){f?Za(;ch8)E!+oLUUy#qc!_2FDAMkDrYM#i<>rue)&b6yJyo=fN zj9Z&=_P4Hu6SsO4T+1*x$e7W`kg2;Tf@Njnbicy58P(78_3jpK2^8Cz`@bqHoSE<2 zQs24kbAEYE+E{gT=EU6Qs#ii&?tc2{wLi^Mbn$#m$NRAfUBwsos_Czs8Cawk!CKTa zOQ)dtmx}F{;%Q=1r|q`>IHN8$^SNofPxAvOK6|&7t5z{DzyJMMkx2BDCGx Int { + return 1 + } + + func pickerView(view: UIPickerView, numberOfRowsInComponent component: Int) -> Int { + return AllExamples.count + } + + func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, + reusingView view: UIView?) -> UIView { + let label = UILabel() + label.text = AllExamples[row].rawValue + label.font = UIFont(name: "Courier", size: 15) + label.textAlignment = NSTextAlignment.Center + label.textColor = UIColor.blackColor() + return label + } + + private func startAnimation(type: AnimationExampleType) { + animatedView.transform = CGAffineTransformIdentity + switch (type) { + case .FadeIn: + animatedView.fadeIn() + case .FadeOut: + animatedView.alpha = 1 + animatedView.fadeOut() + case .PopIn: + animatedView.popIn() + case .PopOut: + animatedView.alpha = 1 + animatedView.popOut() + case .SlideInFromTop: + animatedView.slideIn(from: .Top) + case .SlideInFromBottom: + animatedView.slideIn(from: .Bottom) + case .SlideInFromLeft: + animatedView.slideIn(from: .Left) + case .SlideInFromRight: + animatedView.slideIn(from: .Right) + case .SlideOutToTop: + animatedView.alpha = 1 + animatedView.slideOut(to: .Top) + case .SlideOutToBottom: + animatedView.alpha = 1 + animatedView.slideOut(to: .Bottom) + case .SlideOutToLeft: + animatedView.alpha = 1 + animatedView.slideOut(to: .Left) + case .SlideOutToRight: + animatedView.alpha = 1 + animatedView.slideOut(to: .Right) + case .BounceInFromTop: + animatedView.bounceIn(from: .Top) + case .BounceInFromBottom: + animatedView.bounceIn(from: .Bottom) + case .BounceInFromLeft: + animatedView.bounceIn(from: .Left) + case .BounceInFromRight: + animatedView.bounceIn(from: .Right) + case .BounceOutToTop: + animatedView.alpha = 1 + animatedView.bounceOut(to: .Top) + case .BounceOutToBottom: + animatedView.alpha = 1 + animatedView.bounceOut(to: .Bottom) + case .BounceOutToLeft: + animatedView.bounceOut(to: .Left) + animatedView.alpha = 1 + case .BounceOutToRight: + animatedView.alpha = 1 + animatedView.bounceOut(to: .Right) + case .Shake: + animatedView.alpha = 1 + animatedView.shake() + case .ShakeTowardLeft: + animatedView.alpha = 1 + animatedView.shake(toward: .Left) + case .ShakeTowardTop: + animatedView.alpha = 1 + animatedView.shake(toward: .Top) + case .Hop: + animatedView.alpha = 1 + animatedView.hop() + case .HopTowardTop: + animatedView.alpha = 1 + animatedView.hop(toward: .Top) + case .HopTowardBottom: + animatedView.alpha = 1 + animatedView.hop(toward: .Bottom) + case .HopTowardLeft: + animatedView.alpha = 1 + animatedView.hop(toward: .Left) + case .HopTowardRight: + animatedView.alpha = 1 + animatedView.hop(toward: .Right) + } + } } diff --git a/SimpleAnimation/Classes/ReplaceMe.swift b/SimpleAnimation/Classes/ReplaceMe.swift deleted file mode 100644 index e69de29..0000000 diff --git a/SimpleAnimation/Classes/UIView+SimpleAnimation.swift b/SimpleAnimation/Classes/UIView+SimpleAnimation.swift new file mode 100644 index 0000000..12b90f8 --- /dev/null +++ b/SimpleAnimation/Classes/UIView+SimpleAnimation.swift @@ -0,0 +1,230 @@ +// +// UIView+SimpleAnimation.swift +// SimpleAnimation.swift +// +// Created by Keith Ito on 4/19/16. +// + +import UIKit + + +public enum SimpleAnimationEdge { + case None + case Top + case Bottom + case Left + case Right +} + +public extension UIView { + func fadeIn(duration: NSTimeInterval = 0.25, + delay: NSTimeInterval = 0) -> UIView { + hidden = false + alpha = 0 + UIView.animateWithDuration( + duration, delay: delay, options: .CurveEaseInOut, animations: { + self.alpha = 1 + }, completion: nil) + return self + } + + func fadeOut(duration: NSTimeInterval = 0.25, + delay: NSTimeInterval = 0) -> UIView { + UIView.animateWithDuration( + duration, delay: delay, options: .CurveEaseOut, animations: { + self.alpha = 0 + }, completion: nil) + return self + } + + func slideIn(from edge: SimpleAnimationEdge = .None, + x: CGFloat = 0, + y: CGFloat = 0, + duration: NSTimeInterval = 0.4, + delay: NSTimeInterval = 0) -> UIView { + let offset = offsetForEdge(edge) + transform = CGAffineTransformMakeTranslation(offset.x + x, offset.y + y) + hidden = false + UIView.animateWithDuration( + duration, delay: delay, usingSpringWithDamping: 1, initialSpringVelocity: 2, + options: .CurveEaseOut, animations: { + self.transform = CGAffineTransformIdentity + self.alpha = 1 + }, completion: nil) + return self + } + + func slideOut(to edge: SimpleAnimationEdge = .None, + x: CGFloat = 0, + y: CGFloat = 0, + duration: NSTimeInterval = 0.25, + delay: NSTimeInterval = 0) -> UIView { + let offset = offsetForEdge(edge) + let endTransform = CGAffineTransformMakeTranslation(offset.x + x, offset.y + y) + UIView.animateWithDuration( + duration, delay: delay, options: .CurveEaseOut, animations: { + self.transform = endTransform + }, completion: nil) + return self + } + + func bounceIn(from edge: SimpleAnimationEdge = .None, + x: CGFloat = 0, + y: CGFloat = 0, + duration: NSTimeInterval = 0.5, + delay: NSTimeInterval = 0) -> UIView { + let offset = offsetForEdge(edge) + transform = CGAffineTransformMakeTranslation(offset.x + x, offset.y + y) + hidden = false + UIView.animateWithDuration( + duration, delay: delay, usingSpringWithDamping: 0.58, initialSpringVelocity: 3, + options: .CurveEaseOut, animations: { + self.transform = CGAffineTransformIdentity + self.alpha = 1 + }, completion: nil) + return self + } + + func bounceOut(to edge: SimpleAnimationEdge = .None, + x: CGFloat = 0, + y: CGFloat = 0, + duration: NSTimeInterval = 0.35, + delay: NSTimeInterval = 0) -> UIView { + let offset = offsetForEdge(edge) + let delta = CGPoint(x: offset.x + x, y: offset.y + y) + let endTransform = CGAffineTransformMakeTranslation(delta.x, delta.y) + let prepareTransform = CGAffineTransformMakeTranslation(-delta.x * 0.2, -delta.y * 0.2) + UIView.animateKeyframesWithDuration( + duration, delay: delay, options: .CalculationModeCubic, animations: { + UIView.addKeyframeWithRelativeStartTime(0, relativeDuration: 0.2) { + self.transform = prepareTransform + } + UIView.addKeyframeWithRelativeStartTime(0.2, relativeDuration: 0.2) { + self.transform = prepareTransform + } + UIView.addKeyframeWithRelativeStartTime(0.4, relativeDuration: 0.6) { + self.transform = endTransform + } + }, completion: nil) + return self + } + + func popIn(duration: NSTimeInterval = 0.5, + delay: NSTimeInterval = 0, + fromScale: CGFloat = 0.5) -> UIView { + hidden = false + alpha = 0 + transform = CGAffineTransformMakeScale(fromScale, fromScale) + UIView.animateWithDuration( + duration, delay: delay, usingSpringWithDamping: 0.55, initialSpringVelocity: 3, + options: .CurveEaseOut, animations: { + self.transform = CGAffineTransformIdentity + self.alpha = 1 + }, completion: nil) + return self + } + + func popOut(duration: NSTimeInterval = 0.3, + delay: NSTimeInterval = 0, + toScale: CGFloat = 0.5) -> UIView { + let endTransform = CGAffineTransformMakeScale(toScale, toScale) + let prepareTransform = CGAffineTransformMakeScale(1.1, 1.1) + UIView.animateKeyframesWithDuration( + duration, delay: delay, options: .CalculationModeCubic, animations: { + UIView.addKeyframeWithRelativeStartTime(0, relativeDuration: 0.2) { + self.transform = prepareTransform + } + UIView.addKeyframeWithRelativeStartTime(0.2, relativeDuration: 0.3) { + self.transform = prepareTransform + } + UIView.addKeyframeWithRelativeStartTime(0.5, relativeDuration: 0.5) { + self.transform = endTransform + self.alpha = 0 + } + }, completion: nil) + return self + } + + func hop(toward edge: SimpleAnimationEdge = .None, + amount: CGFloat = 0.4, + duration: NSTimeInterval = 0.6, + delay: NSTimeInterval = 0) -> UIView { + var dx: CGFloat = 0, dy: CGFloat = 0, ds: CGFloat = 0 + if edge == .None { + ds = amount / 2 + } else if edge == .Left || edge == .Right { + dx = (edge == .Left ? -1 : 1) * self.bounds.size.width * amount; + dy = 0 + } else { + dx = 0 + dy = (edge == .Top ? -1 : 1) * self.bounds.size.height * amount; + } + UIView.animateKeyframesWithDuration( + duration, delay: delay, options: .CalculationModeLinear, animations: { + UIView.addKeyframeWithRelativeStartTime(0, relativeDuration: 0.28) { + let t = CGAffineTransformMakeTranslation(dx, dy) + self.transform = CGAffineTransformScale(t, 1 + ds, 1 + ds) + } + UIView.addKeyframeWithRelativeStartTime(0.28, relativeDuration: 0.28) { + self.transform = CGAffineTransformIdentity + } + UIView.addKeyframeWithRelativeStartTime(0.56, relativeDuration: 0.28) { + let t = CGAffineTransformMakeTranslation(dx * 0.5, dy * 0.5) + self.transform = CGAffineTransformScale(t, 1 + ds * 0.5, 1 + ds * 0.5) + } + UIView.addKeyframeWithRelativeStartTime(0.84, relativeDuration: 0.16) { + self.transform = CGAffineTransformIdentity + } + }, completion: nil) + return self + } + + func shake(toward edge: SimpleAnimationEdge = .None, + amount: CGFloat = 0.15, + duration: NSTimeInterval = 0.6, + delay: NSTimeInterval = 0) -> UIView { + let steps = 8 + let timeStep = 1.0 / Double(steps) + var dx: CGFloat, dy: CGFloat + if edge == .Left || edge == .Right { + dx = (edge == .Left ? -1 : 1) * self.bounds.size.width * amount; + dy = 0 + } else { + dx = 0 + dy = (edge == .Top ? -1 : 1) * self.bounds.size.height * amount; + } + UIView.animateKeyframesWithDuration( + duration, delay: delay, options: .CalculationModeCubic, animations: { + var start = 0.0 + for i in 0..<(steps - 1) { + UIView.addKeyframeWithRelativeStartTime(start, relativeDuration: timeStep) { + self.transform = CGAffineTransformMakeTranslation(dx, dy) + } + if (edge == .None && i % 2 == 0) { + swap(&dx, &dy) // Change direction + dy *= -1 + } + dx *= -0.85 + dy *= -0.85 + start += timeStep + } + UIView.addKeyframeWithRelativeStartTime(start, relativeDuration: timeStep) { + self.transform = CGAffineTransformIdentity + } + }, completion: nil) + return self + } + + private func offsetForEdge(edge: SimpleAnimationEdge) -> CGPoint { + if let parentSize = self.superview?.frame.size { + switch edge { + case .None: return CGPointZero + case .Top: return CGPoint(x: 0, y: -CGRectGetMaxY(frame)) + case .Bottom: return CGPoint(x: 0, y: parentSize.height - CGRectGetMinY(frame)) + case .Left: return CGPoint(x: -CGRectGetMaxX(frame), y: 0) + case .Right: return CGPoint(x: parentSize.width - CGRectGetMinX(frame), y: 0) + } + } + return CGPointZero + } +}