From efdf5c91f9d86fc7250932c9aa3cff621f181d5a Mon Sep 17 00:00:00 2001 From: Avo Muradyan Date: Sun, 11 Jan 2015 23:13:18 -0500 Subject: [PATCH] initial check in of the code --- .../project.pbxproj | 474 ++++++++++++++++++ .../AnimationsExampleApp/AppDelegate.swift | 46 ++ .../Base.lproj/LaunchScreen.xib | 41 ++ .../Base.lproj/Main.storyboard | 61 +++ .../AppIcon.appiconset/Contents.json | 68 +++ .../AnimationsExampleApp/Info.plist | 47 ++ .../AnimationsExampleApp/ViewController.swift | 92 ++++ .../AnimationsExampleAppTests.swift | 36 ++ .../AnimationsExampleAppTests/Info.plist | 24 + .../contents.xcworkspacedata | 10 + .../Swanimation.xcodeproj/project.pbxproj | 427 ++++++++++++++++ Swanimation/Swanimation/Bouncers.swift | 134 +++++ Swanimation/Swanimation/Direction.swift | 16 + Swanimation/Swanimation/Faders.swift | 131 +++++ Swanimation/Swanimation/Info.plist | 26 + Swanimation/Swanimation/Swanimation.h | 19 + Swanimation/SwanimationTests/Info.plist | 24 + .../SwanimationTests/SwanimationTests.swift | 36 ++ 18 files changed, 1712 insertions(+) create mode 100644 AnimationsExampleApp/AnimationsExampleApp.xcodeproj/project.pbxproj create mode 100644 AnimationsExampleApp/AnimationsExampleApp/AppDelegate.swift create mode 100644 AnimationsExampleApp/AnimationsExampleApp/Base.lproj/LaunchScreen.xib create mode 100644 AnimationsExampleApp/AnimationsExampleApp/Base.lproj/Main.storyboard create mode 100644 AnimationsExampleApp/AnimationsExampleApp/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 AnimationsExampleApp/AnimationsExampleApp/Info.plist create mode 100644 AnimationsExampleApp/AnimationsExampleApp/ViewController.swift create mode 100644 AnimationsExampleApp/AnimationsExampleAppTests/AnimationsExampleAppTests.swift create mode 100644 AnimationsExampleApp/AnimationsExampleAppTests/Info.plist create mode 100644 Swanimation.xcworkspace/contents.xcworkspacedata create mode 100644 Swanimation/Swanimation.xcodeproj/project.pbxproj create mode 100644 Swanimation/Swanimation/Bouncers.swift create mode 100644 Swanimation/Swanimation/Direction.swift create mode 100644 Swanimation/Swanimation/Faders.swift create mode 100644 Swanimation/Swanimation/Info.plist create mode 100644 Swanimation/Swanimation/Swanimation.h create mode 100644 Swanimation/SwanimationTests/Info.plist create mode 100644 Swanimation/SwanimationTests/SwanimationTests.swift diff --git a/AnimationsExampleApp/AnimationsExampleApp.xcodeproj/project.pbxproj b/AnimationsExampleApp/AnimationsExampleApp.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4d86f68 --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleApp.xcodeproj/project.pbxproj @@ -0,0 +1,474 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8115FDE51A60326B00D9A2A8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8115FDE41A60326B00D9A2A8 /* AppDelegate.swift */; }; + 8115FDE71A60326B00D9A2A8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8115FDE61A60326B00D9A2A8 /* ViewController.swift */; }; + 8115FDEA1A60326B00D9A2A8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8115FDE81A60326B00D9A2A8 /* Main.storyboard */; }; + 8115FDEC1A60326B00D9A2A8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8115FDEB1A60326B00D9A2A8 /* Images.xcassets */; }; + 8115FDEF1A60326B00D9A2A8 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8115FDED1A60326B00D9A2A8 /* LaunchScreen.xib */; }; + 8115FDFB1A60326B00D9A2A8 /* AnimationsExampleAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8115FDFA1A60326B00D9A2A8 /* AnimationsExampleAppTests.swift */; }; + 8115FE0D1A6082A300D9A2A8 /* Swanimation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8115FE0A1A60328A00D9A2A8 /* Swanimation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8115FDF51A60326B00D9A2A8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8115FDD71A60326A00D9A2A8 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8115FDDE1A60326B00D9A2A8; + remoteInfo = AnimationsExampleApp; + }; + 8115FE091A60328A00D9A2A8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8115FE041A60328A00D9A2A8 /* Swanimation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8115FDB81A60274700D9A2A8; + remoteInfo = Swanimation; + }; + 8115FE0B1A60328A00D9A2A8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8115FE041A60328A00D9A2A8 /* Swanimation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8115FDC31A60274700D9A2A8; + remoteInfo = SwanimationTests; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8115FDDF1A60326B00D9A2A8 /* AnimationsExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimationsExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8115FDE31A60326B00D9A2A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8115FDE41A60326B00D9A2A8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 8115FDE61A60326B00D9A2A8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 8115FDE91A60326B00D9A2A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8115FDEB1A60326B00D9A2A8 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 8115FDEE1A60326B00D9A2A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 8115FDF41A60326B00D9A2A8 /* AnimationsExampleAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AnimationsExampleAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 8115FDF91A60326B00D9A2A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8115FDFA1A60326B00D9A2A8 /* AnimationsExampleAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimationsExampleAppTests.swift; sourceTree = ""; }; + 8115FE041A60328A00D9A2A8 /* Swanimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Swanimation.xcodeproj; path = ../Swanimation/Swanimation.xcodeproj; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8115FDDC1A60326B00D9A2A8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8115FE0D1A6082A300D9A2A8 /* Swanimation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8115FDF11A60326B00D9A2A8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8115FDD61A60326A00D9A2A8 = { + isa = PBXGroup; + children = ( + 8115FE041A60328A00D9A2A8 /* Swanimation.xcodeproj */, + 8115FDE11A60326B00D9A2A8 /* AnimationsExampleApp */, + 8115FDF71A60326B00D9A2A8 /* AnimationsExampleAppTests */, + 8115FDE01A60326B00D9A2A8 /* Products */, + ); + sourceTree = ""; + }; + 8115FDE01A60326B00D9A2A8 /* Products */ = { + isa = PBXGroup; + children = ( + 8115FDDF1A60326B00D9A2A8 /* AnimationsExampleApp.app */, + 8115FDF41A60326B00D9A2A8 /* AnimationsExampleAppTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8115FDE11A60326B00D9A2A8 /* AnimationsExampleApp */ = { + isa = PBXGroup; + children = ( + 8115FDE41A60326B00D9A2A8 /* AppDelegate.swift */, + 8115FDE61A60326B00D9A2A8 /* ViewController.swift */, + 8115FDE81A60326B00D9A2A8 /* Main.storyboard */, + 8115FDEB1A60326B00D9A2A8 /* Images.xcassets */, + 8115FDED1A60326B00D9A2A8 /* LaunchScreen.xib */, + 8115FDE21A60326B00D9A2A8 /* Supporting Files */, + ); + path = AnimationsExampleApp; + sourceTree = ""; + }; + 8115FDE21A60326B00D9A2A8 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8115FDE31A60326B00D9A2A8 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8115FDF71A60326B00D9A2A8 /* AnimationsExampleAppTests */ = { + isa = PBXGroup; + children = ( + 8115FDFA1A60326B00D9A2A8 /* AnimationsExampleAppTests.swift */, + 8115FDF81A60326B00D9A2A8 /* Supporting Files */, + ); + path = AnimationsExampleAppTests; + sourceTree = ""; + }; + 8115FDF81A60326B00D9A2A8 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8115FDF91A60326B00D9A2A8 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8115FE051A60328A00D9A2A8 /* Products */ = { + isa = PBXGroup; + children = ( + 8115FE0A1A60328A00D9A2A8 /* Swanimation.framework */, + 8115FE0C1A60328A00D9A2A8 /* SwanimationTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8115FDDE1A60326B00D9A2A8 /* AnimationsExampleApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8115FDFE1A60326B00D9A2A8 /* Build configuration list for PBXNativeTarget "AnimationsExampleApp" */; + buildPhases = ( + 8115FDDB1A60326B00D9A2A8 /* Sources */, + 8115FDDC1A60326B00D9A2A8 /* Frameworks */, + 8115FDDD1A60326B00D9A2A8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AnimationsExampleApp; + productName = AnimationsExampleApp; + productReference = 8115FDDF1A60326B00D9A2A8 /* AnimationsExampleApp.app */; + productType = "com.apple.product-type.application"; + }; + 8115FDF31A60326B00D9A2A8 /* AnimationsExampleAppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8115FE011A60326B00D9A2A8 /* Build configuration list for PBXNativeTarget "AnimationsExampleAppTests" */; + buildPhases = ( + 8115FDF01A60326B00D9A2A8 /* Sources */, + 8115FDF11A60326B00D9A2A8 /* Frameworks */, + 8115FDF21A60326B00D9A2A8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8115FDF61A60326B00D9A2A8 /* PBXTargetDependency */, + ); + name = AnimationsExampleAppTests; + productName = AnimationsExampleAppTests; + productReference = 8115FDF41A60326B00D9A2A8 /* AnimationsExampleAppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8115FDD71A60326A00D9A2A8 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Swanimation; + TargetAttributes = { + 8115FDDE1A60326B00D9A2A8 = { + CreatedOnToolsVersion = 6.1.1; + }; + 8115FDF31A60326B00D9A2A8 = { + CreatedOnToolsVersion = 6.1.1; + TestTargetID = 8115FDDE1A60326B00D9A2A8; + }; + }; + }; + buildConfigurationList = 8115FDDA1A60326A00D9A2A8 /* Build configuration list for PBXProject "AnimationsExampleApp" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8115FDD61A60326A00D9A2A8; + productRefGroup = 8115FDE01A60326B00D9A2A8 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 8115FE051A60328A00D9A2A8 /* Products */; + ProjectRef = 8115FE041A60328A00D9A2A8 /* Swanimation.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 8115FDDE1A60326B00D9A2A8 /* AnimationsExampleApp */, + 8115FDF31A60326B00D9A2A8 /* AnimationsExampleAppTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 8115FE0A1A60328A00D9A2A8 /* Swanimation.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Swanimation.framework; + remoteRef = 8115FE091A60328A00D9A2A8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8115FE0C1A60328A00D9A2A8 /* SwanimationTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = SwanimationTests.xctest; + remoteRef = 8115FE0B1A60328A00D9A2A8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 8115FDDD1A60326B00D9A2A8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8115FDEA1A60326B00D9A2A8 /* Main.storyboard in Resources */, + 8115FDEF1A60326B00D9A2A8 /* LaunchScreen.xib in Resources */, + 8115FDEC1A60326B00D9A2A8 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8115FDF21A60326B00D9A2A8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8115FDDB1A60326B00D9A2A8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8115FDE71A60326B00D9A2A8 /* ViewController.swift in Sources */, + 8115FDE51A60326B00D9A2A8 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8115FDF01A60326B00D9A2A8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8115FDFB1A60326B00D9A2A8 /* AnimationsExampleAppTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8115FDF61A60326B00D9A2A8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8115FDDE1A60326B00D9A2A8 /* AnimationsExampleApp */; + targetProxy = 8115FDF51A60326B00D9A2A8 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 8115FDE81A60326B00D9A2A8 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8115FDE91A60326B00D9A2A8 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8115FDED1A60326B00D9A2A8 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 8115FDEE1A60326B00D9A2A8 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8115FDFC1A60326B00D9A2A8 /* 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; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + 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.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 8115FDFD1A60326B00D9A2A8 /* 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 = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8115FDFF1A60326B00D9A2A8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = AnimationsExampleApp/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 8115FE001A60326B00D9A2A8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = AnimationsExampleApp/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 8115FE021A60326B00D9A2A8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = AnimationsExampleAppTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AnimationsExampleApp.app/AnimationsExampleApp"; + }; + name = Debug; + }; + 8115FE031A60326B00D9A2A8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = AnimationsExampleAppTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AnimationsExampleApp.app/AnimationsExampleApp"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8115FDDA1A60326A00D9A2A8 /* Build configuration list for PBXProject "AnimationsExampleApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8115FDFC1A60326B00D9A2A8 /* Debug */, + 8115FDFD1A60326B00D9A2A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8115FDFE1A60326B00D9A2A8 /* Build configuration list for PBXNativeTarget "AnimationsExampleApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8115FDFF1A60326B00D9A2A8 /* Debug */, + 8115FE001A60326B00D9A2A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8115FE011A60326B00D9A2A8 /* Build configuration list for PBXNativeTarget "AnimationsExampleAppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8115FE021A60326B00D9A2A8 /* Debug */, + 8115FE031A60326B00D9A2A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8115FDD71A60326A00D9A2A8 /* Project object */; +} diff --git a/AnimationsExampleApp/AnimationsExampleApp/AppDelegate.swift b/AnimationsExampleApp/AnimationsExampleApp/AppDelegate.swift new file mode 100644 index 0000000..8101191 --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleApp/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// AnimationsExampleApp +// +// Created by AM on 1/9/15. +// Copyright (c) 2015 Swanimation. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> 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:. + } + + +} + diff --git a/AnimationsExampleApp/AnimationsExampleApp/Base.lproj/LaunchScreen.xib b/AnimationsExampleApp/AnimationsExampleApp/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..f43fc7e --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleApp/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AnimationsExampleApp/AnimationsExampleApp/Base.lproj/Main.storyboard b/AnimationsExampleApp/AnimationsExampleApp/Base.lproj/Main.storyboard new file mode 100644 index 0000000..20b8977 --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleApp/Base.lproj/Main.storyboard @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AnimationsExampleApp/AnimationsExampleApp/Images.xcassets/AppIcon.appiconset/Contents.json b/AnimationsExampleApp/AnimationsExampleApp/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleApp/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/AnimationsExampleApp/AnimationsExampleApp/Info.plist b/AnimationsExampleApp/AnimationsExampleApp/Info.plist new file mode 100644 index 0000000..4492762 --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleApp/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.swanimation.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/AnimationsExampleApp/AnimationsExampleApp/ViewController.swift b/AnimationsExampleApp/AnimationsExampleApp/ViewController.swift new file mode 100644 index 0000000..7dbbe49 --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleApp/ViewController.swift @@ -0,0 +1,92 @@ +// +// ViewController.swift +// AnimationsExampleApp +// +// Created by AM on 1/9/15. +// Copyright (c) 2015 Swanimation. All rights reserved. +// + +import UIKit +import Swanimation + +enum Animations : String { + case FadeIn="FadeIn", FadeOut="FadeOut", + FadeToggle="FadeToggle", FadeInEnterLeft="FadeInEnterLeft", + FadeInEnterRight="FadeInEnterRight", FadeInEnterTop="FadeInEnterTop", + FadeInEnterBottom="FadeInEnterBottom", Bounce="Bounce", Shake="Shake", + BounceEnterLeft="BounceEnterLeft", BounceEnterRight="BounceEnterRight", + BounceEnterTop="BounceEnterTop", BounceEnterBottom="BounceEnterBottom" + + + static let allValues = [FadeIn, FadeOut, FadeToggle, + FadeInEnterLeft, FadeInEnterRight, FadeInEnterTop, + FadeInEnterBottom, Bounce, Shake, BounceEnterLeft, + BounceEnterRight, BounceEnterTop, BounceEnterBottom] +} + +class ViewController: UIViewController, UIPickerViewDelegate { + + @IBOutlet weak var animationLabel: UILabel! + @IBOutlet weak var animationPicker: UIPickerView! + + let animations = Animations.allValues + + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @IBAction func animate(sender: UIButton) { + + switch animations[animationPicker.selectedRowInComponent(0)] { + case .FadeIn: + animationLabel.fadeIn() + case .FadeOut: + animationLabel.fadeOut() + case .FadeToggle: + animationLabel.fadeToggle() + case .FadeInEnterLeft: + animationLabel.fadeInEnterLeft() + case .FadeInEnterRight: + animationLabel.fadeInEnterRight() + case .FadeInEnterTop: + animationLabel.fadeInEnterTop() + case .FadeInEnterBottom: + animationLabel.fadeInEnterBottom() + case .Bounce: + animationLabel.bounce() + case .Shake: + animationLabel.shake() + case .BounceEnterLeft: + animationLabel.bounceEnterLeft() + case .BounceEnterRight: + animationLabel.bounceEnterRight() + case .BounceEnterTop: + animationLabel.bounceEnterTop() + case .BounceEnterBottom: + animationLabel.bounceEnterBottom() + default: + fatalError("Unknown Swanimation") + } + } + + func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { + return 1 + } + + func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { + return animations.count + } + + func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! { + return animations[row].rawValue + } + +} + diff --git a/AnimationsExampleApp/AnimationsExampleAppTests/AnimationsExampleAppTests.swift b/AnimationsExampleApp/AnimationsExampleAppTests/AnimationsExampleAppTests.swift new file mode 100644 index 0000000..e06dfbc --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleAppTests/AnimationsExampleAppTests.swift @@ -0,0 +1,36 @@ +// +// AnimationsExampleAppTests.swift +// AnimationsExampleAppTests +// +// Created by AM on 1/9/15. +// Copyright (c) 2015 Swanimation. All rights reserved. +// + +import UIKit +import XCTest + +class AnimationsExampleAppTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/AnimationsExampleApp/AnimationsExampleAppTests/Info.plist b/AnimationsExampleApp/AnimationsExampleAppTests/Info.plist new file mode 100644 index 0000000..2808a4f --- /dev/null +++ b/AnimationsExampleApp/AnimationsExampleAppTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.swanimation.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Swanimation.xcworkspace/contents.xcworkspacedata b/Swanimation.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..27222dc --- /dev/null +++ b/Swanimation.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Swanimation/Swanimation.xcodeproj/project.pbxproj b/Swanimation/Swanimation.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2d715f9 --- /dev/null +++ b/Swanimation/Swanimation.xcodeproj/project.pbxproj @@ -0,0 +1,427 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 8115FDBE1A60274700D9A2A8 /* Swanimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8115FDBD1A60274700D9A2A8 /* Swanimation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8115FDC41A60274700D9A2A8 /* Swanimation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8115FDB81A60274700D9A2A8 /* Swanimation.framework */; }; + 8115FDCB1A60274700D9A2A8 /* SwanimationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8115FDCA1A60274700D9A2A8 /* SwanimationTests.swift */; }; + 8115FDD51A602E1400D9A2A8 /* Faders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8115FDD41A602E1400D9A2A8 /* Faders.swift */; }; + 8141F9B51A6326CC001C3AB6 /* Direction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8141F9B41A6326CC001C3AB6 /* Direction.swift */; }; + 8141F9B71A6343E3001C3AB6 /* Bouncers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8141F9B61A6343E3001C3AB6 /* Bouncers.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8115FDC51A60274700D9A2A8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8115FDAF1A60274700D9A2A8 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8115FDB71A60274700D9A2A8; + remoteInfo = Swanimation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 8115FDB81A60274700D9A2A8 /* Swanimation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Swanimation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8115FDBC1A60274700D9A2A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8115FDBD1A60274700D9A2A8 /* Swanimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Swanimation.h; sourceTree = ""; }; + 8115FDC31A60274700D9A2A8 /* SwanimationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwanimationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 8115FDC91A60274700D9A2A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8115FDCA1A60274700D9A2A8 /* SwanimationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwanimationTests.swift; sourceTree = ""; }; + 8115FDD41A602E1400D9A2A8 /* Faders.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Faders.swift; sourceTree = ""; }; + 8141F9B41A6326CC001C3AB6 /* Direction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Direction.swift; sourceTree = ""; }; + 8141F9B61A6343E3001C3AB6 /* Bouncers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bouncers.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8115FDB41A60274700D9A2A8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8115FDC01A60274700D9A2A8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8115FDC41A60274700D9A2A8 /* Swanimation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8115FDAE1A60274700D9A2A8 = { + isa = PBXGroup; + children = ( + 8115FDBA1A60274700D9A2A8 /* Swanimation */, + 8115FDC71A60274700D9A2A8 /* SwanimationTests */, + 8115FDB91A60274700D9A2A8 /* Products */, + ); + sourceTree = ""; + }; + 8115FDB91A60274700D9A2A8 /* Products */ = { + isa = PBXGroup; + children = ( + 8115FDB81A60274700D9A2A8 /* Swanimation.framework */, + 8115FDC31A60274700D9A2A8 /* SwanimationTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 8115FDBA1A60274700D9A2A8 /* Swanimation */ = { + isa = PBXGroup; + children = ( + 8141F9B61A6343E3001C3AB6 /* Bouncers.swift */, + 8115FDD41A602E1400D9A2A8 /* Faders.swift */, + 8115FDBD1A60274700D9A2A8 /* Swanimation.h */, + 8115FDBB1A60274700D9A2A8 /* Supporting Files */, + 8141F9B41A6326CC001C3AB6 /* Direction.swift */, + ); + path = Swanimation; + sourceTree = ""; + }; + 8115FDBB1A60274700D9A2A8 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8115FDBC1A60274700D9A2A8 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 8115FDC71A60274700D9A2A8 /* SwanimationTests */ = { + isa = PBXGroup; + children = ( + 8115FDCA1A60274700D9A2A8 /* SwanimationTests.swift */, + 8115FDC81A60274700D9A2A8 /* Supporting Files */, + ); + path = SwanimationTests; + sourceTree = ""; + }; + 8115FDC81A60274700D9A2A8 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 8115FDC91A60274700D9A2A8 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8115FDB51A60274700D9A2A8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 8115FDBE1A60274700D9A2A8 /* Swanimation.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8115FDB71A60274700D9A2A8 /* Swanimation */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8115FDCE1A60274700D9A2A8 /* Build configuration list for PBXNativeTarget "Swanimation" */; + buildPhases = ( + 8115FDB31A60274700D9A2A8 /* Sources */, + 8115FDB41A60274700D9A2A8 /* Frameworks */, + 8115FDB51A60274700D9A2A8 /* Headers */, + 8115FDB61A60274700D9A2A8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Swanimation; + productName = Swanimation; + productReference = 8115FDB81A60274700D9A2A8 /* Swanimation.framework */; + productType = "com.apple.product-type.framework"; + }; + 8115FDC21A60274700D9A2A8 /* SwanimationTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8115FDD11A60274700D9A2A8 /* Build configuration list for PBXNativeTarget "SwanimationTests" */; + buildPhases = ( + 8115FDBF1A60274700D9A2A8 /* Sources */, + 8115FDC01A60274700D9A2A8 /* Frameworks */, + 8115FDC11A60274700D9A2A8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8115FDC61A60274700D9A2A8 /* PBXTargetDependency */, + ); + name = SwanimationTests; + productName = SwanimationTests; + productReference = 8115FDC31A60274700D9A2A8 /* SwanimationTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8115FDAF1A60274700D9A2A8 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0610; + ORGANIZATIONNAME = Swanimation; + TargetAttributes = { + 8115FDB71A60274700D9A2A8 = { + CreatedOnToolsVersion = 6.1.1; + }; + 8115FDC21A60274700D9A2A8 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; + }; + buildConfigurationList = 8115FDB21A60274700D9A2A8 /* Build configuration list for PBXProject "Swanimation" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 8115FDAE1A60274700D9A2A8; + productRefGroup = 8115FDB91A60274700D9A2A8 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8115FDB71A60274700D9A2A8 /* Swanimation */, + 8115FDC21A60274700D9A2A8 /* SwanimationTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8115FDB61A60274700D9A2A8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8115FDC11A60274700D9A2A8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8115FDB31A60274700D9A2A8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8115FDD51A602E1400D9A2A8 /* Faders.swift in Sources */, + 8141F9B71A6343E3001C3AB6 /* Bouncers.swift in Sources */, + 8141F9B51A6326CC001C3AB6 /* Direction.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8115FDBF1A60274700D9A2A8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8115FDCB1A60274700D9A2A8 /* SwanimationTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8115FDC61A60274700D9A2A8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8115FDB71A60274700D9A2A8 /* Swanimation */; + targetProxy = 8115FDC51A60274700D9A2A8 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 8115FDCC1A60274700D9A2A8 /* 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; + CURRENT_PROJECT_VERSION = 1; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + 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.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 8115FDCD1A60274700D9A2A8 /* 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 = YES; + CURRENT_PROJECT_VERSION = 1; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 8115FDCF1A60274700D9A2A8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Swanimation/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8115FDD01A60274700D9A2A8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Swanimation/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 8115FDD21A60274700D9A2A8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = SwanimationTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 8115FDD31A60274700D9A2A8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = SwanimationTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8115FDB21A60274700D9A2A8 /* Build configuration list for PBXProject "Swanimation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8115FDCC1A60274700D9A2A8 /* Debug */, + 8115FDCD1A60274700D9A2A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8115FDCE1A60274700D9A2A8 /* Build configuration list for PBXNativeTarget "Swanimation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8115FDCF1A60274700D9A2A8 /* Debug */, + 8115FDD01A60274700D9A2A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8115FDD11A60274700D9A2A8 /* Build configuration list for PBXNativeTarget "SwanimationTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8115FDD21A60274700D9A2A8 /* Debug */, + 8115FDD31A60274700D9A2A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8115FDAF1A60274700D9A2A8 /* Project object */; +} diff --git a/Swanimation/Swanimation/Bouncers.swift b/Swanimation/Swanimation/Bouncers.swift new file mode 100644 index 0000000..3fc0f66 --- /dev/null +++ b/Swanimation/Swanimation/Bouncers.swift @@ -0,0 +1,134 @@ +// +// Bouncers.swift +// Swanimation +// +// Created by AM on 1/11/15. +// Copyright (c) 2015 Swanimation. All rights reserved. +// + +import UIKit + +extension UIView { + + public func bounce(duration:Double = 1, delay:Double = 0.0, + springWithDamping:Double = 0.3, initialSpringVelocity:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + let damping : CGFloat = CGFloat(springWithDamping) + let aimationVelocity : CGFloat = CGFloat(initialSpringVelocity) + + let initialCenter = self.center + // TODO::make the offset value a parameter + self.center = CGPoint(x: initialCenter.x, y: initialCenter.y - 15) + + UIView.animateWithDuration(duration, delay: delay, + usingSpringWithDamping: damping, initialSpringVelocity: aimationVelocity, + options: options, + animations: { + self.center = initialCenter + }, completion: completion) + } + + public func shake(duration:Double = 0.5, delay:Double = 0.0, + springWithDamping:Double = 0.1, initialSpringVelocity:Double = 10.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + let damping : CGFloat = CGFloat(springWithDamping) + let aimationVelocity : CGFloat = CGFloat(initialSpringVelocity) + + let initialCenter = self.center + self.center = CGPoint(x: initialCenter.x - 15, y: initialCenter.y) + + UIView.animateWithDuration(duration, delay: delay, + usingSpringWithDamping: damping, initialSpringVelocity: aimationVelocity, + options: options, + animations: { + self.center = initialCenter + }, completion: completion) + } + + public func bounceEnterLeft(duration:Double = 1.0, delay:Double = 0.0, + springWithDamping:Double = 0.5, initialSpringVelocity:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + bounceEnter(duration: duration, delay: delay, from: Direction.Left, springWithDamping: springWithDamping, initialSpringVelocity: initialSpringVelocity, options: options, completion: completion) + } + + public func bounceEnterRight(duration:Double = 1.0, delay:Double = 0.0, + springWithDamping:Double = 0.5, initialSpringVelocity:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + bounceEnter(duration: duration, delay: delay, from: Direction.Right, springWithDamping: springWithDamping, initialSpringVelocity: initialSpringVelocity, options: options, completion: completion) + } + + public func bounceEnterTop(duration:Double = 1.0, delay:Double = 0.0, + springWithDamping:Double = 0.6, initialSpringVelocity:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + bounceEnter(duration: duration, delay: delay, from: Direction.Top, springWithDamping: springWithDamping, initialSpringVelocity: initialSpringVelocity, options: options, completion: completion) + } + + public func bounceEnterBottom(duration:Double = 1.0, delay:Double = 0.0, + springWithDamping:Double = 0.6, initialSpringVelocity:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + bounceEnter(duration: duration, delay: delay, from: Direction.Bottom, springWithDamping: springWithDamping, initialSpringVelocity: initialSpringVelocity, options: options, completion: completion) + } + + public func bounceEnter(duration:Double = 1.0, delay:Double = 0.0, + from:Direction = .Left, springWithDamping:Double = 0.5, initialSpringVelocity:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + let damping : CGFloat = CGFloat(springWithDamping) + let aimationVelocity : CGFloat = CGFloat(initialSpringVelocity) + + switch from { + + case .Left: + self.center.x -= self.window!.rootViewController!.view!.bounds.width + UIView.animateWithDuration(duration, delay: delay, + usingSpringWithDamping: damping, initialSpringVelocity: aimationVelocity, + options: options, + animations: { + self.alpha = 1.0 + self.center.x += self.window!.rootViewController!.view!.bounds.width + }, completion: completion) + + case .Right: + self.center.x += self.window!.rootViewController!.view!.bounds.width + UIView.animateWithDuration(duration, delay: delay, + usingSpringWithDamping: damping, initialSpringVelocity: aimationVelocity, + options: options, + animations: { + self.alpha = 1.0 + self.center.x -= self.window!.rootViewController!.view!.bounds.width + }, completion: completion) + case .Top: + self.center.y -= self.window!.rootViewController!.view!.bounds.height + UIView.animateWithDuration(duration, delay: delay, + usingSpringWithDamping: damping, initialSpringVelocity: aimationVelocity, + options: options, + animations: { + self.alpha = 1.0 + self.center.y += self.window!.rootViewController!.view!.bounds.height + }, completion: completion) + case .Bottom: + self.center.y += self.window!.rootViewController!.view!.bounds.height + UIView.animateWithDuration(duration, delay: delay, + usingSpringWithDamping: damping, initialSpringVelocity: aimationVelocity, + options: options, + animations: { + self.alpha = 1.0 + self.center.y -= self.window!.rootViewController!.view!.bounds.height + }, completion: completion) + }; + } + +} \ No newline at end of file diff --git a/Swanimation/Swanimation/Direction.swift b/Swanimation/Swanimation/Direction.swift new file mode 100644 index 0000000..96c92c7 --- /dev/null +++ b/Swanimation/Swanimation/Direction.swift @@ -0,0 +1,16 @@ +// +// Direction.swift +// Swanimation +// +// Created by AM on 1/11/15. +// Copyright (c) 2015 Swanimation. All rights reserved. +// + +import Foundation + +public enum Direction { + case Left + case Right + case Top + case Bottom +} \ No newline at end of file diff --git a/Swanimation/Swanimation/Faders.swift b/Swanimation/Swanimation/Faders.swift new file mode 100644 index 0000000..276b0ac --- /dev/null +++ b/Swanimation/Swanimation/Faders.swift @@ -0,0 +1,131 @@ +// +// Faders.swift +// Swanimation +// +// Created by AM on 1/9/15. +// Copyright (c) 2015 Swanimation. All rights reserved. +// + +import UIKit + +extension UIView { + + public func fadeIn(duration:Double = 1.0, delay:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + UIView.animateWithDuration(duration, delay: delay, + options: options, + animations: { self.alpha = 1.0 }, + completion: completion) + } + + public func fadeOut(duration:Double = 1.0, delay:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + UIView.animateWithDuration(duration, delay: delay, + options: options, + animations: { self.alpha = 0.0 }, + completion: completion) + } + + public func fadeToggle(duration:Double = 1.0, delay:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + if (self.alpha == 0.0) { + fadeIn(duration: duration, delay: delay, + options: options, completion: completion) + } + else { + fadeOut(duration: duration, delay: delay, + options: options, completion: completion) + } + } + + public func fadeInEnterLeft(duration:Double = 1.0, delay:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + fadeInEnter(duration: duration, delay: delay, from: + Direction.Left, options: options, completion: completion) + } + + public func fadeInEnterRight(duration:Double = 1.0, delay:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + fadeInEnter(duration: duration, delay: delay, from: + Direction.Right, options: options, completion: completion) + } + + public func fadeInEnterTop(duration:Double = 1.0, delay:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + fadeInEnter(duration: duration, delay: delay, from: + Direction.Top, options: options, completion: completion) + } + + public func fadeInEnterBottom(duration:Double = 1.0, delay:Double = 0.0, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + fadeInEnter(duration: duration, delay: delay, from: + Direction.Bottom, options: options, completion: completion) + } + + + public func fadeInEnter(duration:Double = 1.0, delay:Double = 0.0, + from:Direction = .Left, + options: UIViewAnimationOptions = nil, + completion: ((Bool) -> Void)? = nil) { + + self.alpha = 0.0 + + switch from { + + case .Left: + self.center.x -= self.window!.rootViewController!.view!.bounds.width + UIView.animateWithDuration(duration, delay: delay, + options: options, + animations: { + self.alpha = 1.0 + self.center.x += self.window!.rootViewController!.view!.bounds.width + }, completion: completion) + + case .Right: + self.center.x += self.window!.rootViewController!.view!.bounds.width + UIView.animateWithDuration(duration, delay: delay, + options: options, + animations: { + self.alpha = 1.0 + self.center.x -= self.window!.rootViewController!.view!.bounds.width + }, completion: completion) + case .Top: + self.center.y -= self.window!.rootViewController!.view!.bounds.height + UIView.animateWithDuration(duration, delay: delay, + options: options, + animations: { + self.alpha = 1.0 + self.center.y += self.window!.rootViewController!.view!.bounds.height + }, completion: completion) + case .Bottom: + self.center.y += self.window!.rootViewController!.view!.bounds.height + UIView.animateWithDuration(duration, delay: delay, + options: options, + animations: { + self.alpha = 1.0 + self.center.y -= self.window!.rootViewController!.view!.bounds.height + }, completion: completion) + }; + } +} + + + + + + + diff --git a/Swanimation/Swanimation/Info.plist b/Swanimation/Swanimation/Info.plist new file mode 100644 index 0000000..45d12b4 --- /dev/null +++ b/Swanimation/Swanimation/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.swanimation.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Swanimation/Swanimation/Swanimation.h b/Swanimation/Swanimation/Swanimation.h new file mode 100644 index 0000000..a540962 --- /dev/null +++ b/Swanimation/Swanimation/Swanimation.h @@ -0,0 +1,19 @@ +// +// Swanimation.h +// Swanimation +// +// Created by AM on 1/9/15. +// Copyright (c) 2015 Swanimation. All rights reserved. +// + +#import + +//! Project version number for Swanimation. +FOUNDATION_EXPORT double SwanimationVersionNumber; + +//! Project version string for Swanimation. +FOUNDATION_EXPORT const unsigned char SwanimationVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Swanimation/SwanimationTests/Info.plist b/Swanimation/SwanimationTests/Info.plist new file mode 100644 index 0000000..2808a4f --- /dev/null +++ b/Swanimation/SwanimationTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.swanimation.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Swanimation/SwanimationTests/SwanimationTests.swift b/Swanimation/SwanimationTests/SwanimationTests.swift new file mode 100644 index 0000000..3ff94d8 --- /dev/null +++ b/Swanimation/SwanimationTests/SwanimationTests.swift @@ -0,0 +1,36 @@ +// +// SwanimationTests.swift +// SwanimationTests +// +// Created by AM on 1/9/15. +// Copyright (c) 2015 Swanimation. All rights reserved. +// + +import UIKit +import XCTest + +class SwanimationTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +}