From ec9845a58c3baf7dabffcd2f273a811150ff9179 Mon Sep 17 00:00:00 2001 From: Dimitrios Kalaitzidis Date: Mon, 3 Dec 2018 12:43:39 +0200 Subject: [PATCH] Swift 4.2 syntax --- .../JDAnimationKit.xcodeproj/project.pbxproj | 30 +++++++------------ .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++++ Example/JDAnimationKit/AppDelegate.swift | 2 +- Pod/Classes/JDAnimationKit.swift | 14 ++++----- 4 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 Example/JDAnimationKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Example/JDAnimationKit.xcodeproj/project.pbxproj b/Example/JDAnimationKit.xcodeproj/project.pbxproj index 4b1a928..a922cae 100644 --- a/Example/JDAnimationKit.xcodeproj/project.pbxproj +++ b/Example/JDAnimationKit.xcodeproj/project.pbxproj @@ -163,7 +163,6 @@ 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, 52C1E04C2A2149429F554167 /* [CP] Embed Pods Frameworks */, - F53BF809A5C2E2FF97469218 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -259,9 +258,14 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-JDAnimationKit_Example/Pods-JDAnimationKit_Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/JDAnimationKit/JDAnimationKit.framework", + "${BUILT_PRODUCTS_DIR}/pop/pop.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JDAnimationKit.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pop.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -274,28 +278,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-JDAnimationKit_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - F53BF809A5C2E2FF97469218 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JDAnimationKit_Example/Pods-JDAnimationKit_Example-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -448,7 +440,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -465,7 +457,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Example/JDAnimationKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/JDAnimationKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/JDAnimationKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/JDAnimationKit/AppDelegate.swift b/Example/JDAnimationKit/AppDelegate.swift index ec8f105..e7f1dd3 100644 --- a/Example/JDAnimationKit/AppDelegate.swift +++ b/Example/JDAnimationKit/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } diff --git a/Pod/Classes/JDAnimationKit.swift b/Pod/Classes/JDAnimationKit.swift index 0eb5819..66c2a0f 100644 --- a/Pod/Classes/JDAnimationKit.swift +++ b/Pod/Classes/JDAnimationKit.swift @@ -77,11 +77,11 @@ extension Array where Element: Equatable { extension Double { func DegreesToRadians() -> Double { - return self * M_PI / 180.0 + return self * .pi / 180.0 } func RadiansToDegrees() -> Double { - return self * 180.0 / M_PI + return self * 180.0 / .pi } } @@ -233,15 +233,15 @@ extension JDAnimationNode{ switch timing{ case .easeIn: - return CAMediaTimingFunction(name:kCAMediaTimingFunctionEaseIn) + return CAMediaTimingFunction(name: .easeIn) case .easeOut: - return CAMediaTimingFunction(name:kCAMediaTimingFunctionEaseOut) + return CAMediaTimingFunction(name: .easeOut) case .easeInOut: - return CAMediaTimingFunction(name:kCAMediaTimingFunctionEaseInEaseOut) + return CAMediaTimingFunction(name: .easeInEaseOut) case .linear: - return CAMediaTimingFunction(name:kCAMediaTimingFunctionLinear) + return CAMediaTimingFunction(name: .linear) case .none: - return CAMediaTimingFunction(name:kCAMediaTimingFunctionDefault) + return CAMediaTimingFunction(name: .default) } }