diff --git a/Animo.podspec b/Animo.podspec index 9bd7267..c94307d 100644 --- a/Animo.podspec +++ b/Animo.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Animo" - s.version = "1.4.0" - s.swift_version = "4.1" + s.version = "1.5.0" + s.swift_version = "5.0" s.license = "MIT" s.summary = "Bring life to CALayers with SpriteKit-like animation builders." s.homepage = "https://github.com/eure/Animo" diff --git a/Animo.xcodeproj/project.pbxproj b/Animo.xcodeproj/project.pbxproj index deafbf1..ff79612 100644 --- a/Animo.xcodeproj/project.pbxproj +++ b/Animo.xcodeproj/project.pbxproj @@ -274,16 +274,17 @@ attributes = { LastSwiftMigration = 0710; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "eure, Inc."; TargetAttributes = { B5687D5E1BB45AFC00168B7E = { CreatedOnToolsVersion = 7.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; B5687D681BB45AFC00168B7E = { CreatedOnToolsVersion = 7.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; + ProvisioningStyle = Manual; }; B5F331C21C843944009475AC = { CreatedOnToolsVersion = 7.2.1; @@ -293,10 +294,11 @@ }; buildConfigurationList = B5687D591BB45AFC00168B7E /* Build configuration list for PBXProject "Animo" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = B5687D551BB45AFC00168B7E; productRefGroup = B5687D601BB45AFC00168B7E /* Products */; @@ -392,6 +394,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -400,12 +403,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -454,6 +459,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -462,12 +468,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -519,7 +527,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -536,29 +544,35 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; B5687D771BB45AFC00168B7E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = AnimoTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.eure.ios.AnimoTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; }; name = Debug; }; B5687D781BB45AFC00168B7E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = AnimoTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.eure.ios.AnimoTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Animo.xcodeproj/xcshareddata/xcschemes/Animo-OSX.xcscheme b/Animo.xcodeproj/xcshareddata/xcschemes/Animo-OSX.xcscheme index a44fef7..ec9ab47 100644 --- a/Animo.xcodeproj/xcshareddata/xcschemes/Animo-OSX.xcscheme +++ b/Animo.xcodeproj/xcshareddata/xcschemes/Animo-OSX.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Animo.xcodeproj/xcshareddata/xcschemes/Animo-iOS.xcscheme b/Animo.xcodeproj/xcshareddata/xcschemes/Animo-iOS.xcscheme index 61256e8..ea6684e 100644 --- a/Animo.xcodeproj/xcshareddata/xcschemes/Animo-iOS.xcscheme +++ b/Animo.xcodeproj/xcshareddata/xcschemes/Animo-iOS.xcscheme @@ -1,6 +1,6 @@ CAMediaTimingFillMode { + return CAMediaTimingFillMode(rawValue: input) +} diff --git a/Animo/Internal/Transition+AnimoInternals.swift b/Animo/Internal/Transition+AnimoInternals.swift index 068c34b..1be8744 100644 --- a/Animo/Internal/Transition+AnimoInternals.swift +++ b/Animo/Internal/Transition+AnimoInternals.swift @@ -40,30 +40,41 @@ internal extension Transition { switch direction { - case .leftToRight: return kCATransitionFromLeft - case .rightToLeft: return kCATransitionFromRight - case .topToBottom: return kCATransitionFromTop - case .bottomToTop: return kCATransitionFromBottom + case .leftToRight: return convertFromCATransitionSubtype(CATransitionSubtype.fromLeft) + case .rightToLeft: return convertFromCATransitionSubtype(CATransitionSubtype.fromRight) + case .topToBottom: return convertFromCATransitionSubtype(CATransitionSubtype.fromTop) + case .bottomToTop: return convertFromCATransitionSubtype(CATransitionSubtype.fromBottom) } } switch self { case .fade: - object.type = kCATransitionFade + object.type = CATransitionType.fade object.subtype = nil case .moveIn(let direction): - object.type = kCATransitionMoveIn - object.subtype = subtypeForCATransition(direction) + object.type = CATransitionType.moveIn + object.subtype = convertToOptionalCATransitionSubtype(subtypeForCATransition(direction)) case .push(let direction): - object.type = kCATransitionPush - object.subtype = subtypeForCATransition(direction) + object.type = CATransitionType.push + object.subtype = convertToOptionalCATransitionSubtype(subtypeForCATransition(direction)) case .reveal(let direction): - object.type = kCATransitionReveal - object.subtype = subtypeForCATransition(direction) + object.type = CATransitionType.reveal + object.subtype = convertToOptionalCATransitionSubtype(subtypeForCATransition(direction)) } } } + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertFromCATransitionSubtype(_ input: CATransitionSubtype) -> String { + return input.rawValue +} + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertToOptionalCATransitionSubtype(_ input: String?) -> CATransitionSubtype? { + guard let input = input else { return nil } + return CATransitionSubtype(rawValue: input) +} diff --git a/Animo/Options.swift b/Animo/Options.swift index 5b0eec9..1219b2a 100644 --- a/Animo/Options.swift +++ b/Animo/Options.swift @@ -56,10 +56,10 @@ public struct Options { switch fillMode { - case FillMode.forwards: return kCAFillModeForwards - case FillMode.backwards: return kCAFillModeBackwards - case FillMode.both: return kCAFillModeBoth - default: return kCAFillModeRemoved + case FillMode.forwards: return convertFromCAMediaTimingFillMode(CAMediaTimingFillMode.forwards) + case FillMode.backwards: return convertFromCAMediaTimingFillMode(CAMediaTimingFillMode.backwards) + case FillMode.both: return convertFromCAMediaTimingFillMode(CAMediaTimingFillMode.both) + default: return convertFromCAMediaTimingFillMode(CAMediaTimingFillMode.removed) } } @@ -75,3 +75,8 @@ public struct Options { internal let fillMode: String internal let removedOnCompletion: Bool } + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertFromCAMediaTimingFillMode(_ input: CAMediaTimingFillMode) -> String { + return input.rawValue +} diff --git a/Animo/TimingMode.swift b/Animo/TimingMode.swift index b51ebaa..12784c3 100644 --- a/Animo/TimingMode.swift +++ b/Animo/TimingMode.swift @@ -57,10 +57,10 @@ public enum TimingMode { switch self { - case .linear: return CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) - case .easeIn: return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn) - case .easeOut: return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) - case .easeInOut: return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) + case .linear: return CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear) + case .easeIn: return CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn) + case .easeOut: return CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut) + case .easeInOut: return CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) case .spring(let damping): return CAMediaTimingFunction(controlPoints: 0.5, 1.1 + (Float(damping) / 3.0), 1, 1) case .discrete: return CAMediaTimingFunction(controlPoints: 1, 0, 1, 1)