diff --git a/ChainedAnimation.xcodeproj/project.pbxproj b/ChainedAnimation.xcodeproj/project.pbxproj index ad47f89..ff420f6 100644 --- a/ChainedAnimation.xcodeproj/project.pbxproj +++ b/ChainedAnimation.xcodeproj/project.pbxproj @@ -247,17 +247,17 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = "Silvan Dähn"; TargetAttributes = { AF6A02451D84204900F89BD9 = { CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; AF6A024E1D84204900F89BD9 = { CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0800; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; AF79A3CF1D843C0E0060857F = { @@ -396,6 +396,7 @@ 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_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -403,6 +404,7 @@ 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; @@ -457,6 +459,7 @@ 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_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -464,6 +467,7 @@ 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; @@ -514,7 +518,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -533,7 +537,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.silvandaehn.ChainedAnimation; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -545,6 +549,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.silvandaehn.ChainedAnimationTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -556,6 +561,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.silvandaehn.ChainedAnimationTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/ChainedAnimation.xcodeproj/xcshareddata/xcschemes/ChainedAnimation.xcscheme b/ChainedAnimation.xcodeproj/xcshareddata/xcschemes/ChainedAnimation.xcscheme index 042206b..14af578 100644 --- a/ChainedAnimation.xcodeproj/xcshareddata/xcschemes/ChainedAnimation.xcscheme +++ b/ChainedAnimation.xcodeproj/xcshareddata/xcschemes/ChainedAnimation.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -57,7 +56,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/ChainedAnimation/AnimationChain.swift b/ChainedAnimation/AnimationChain.swift index bae5b32..4169b69 100644 --- a/ChainedAnimation/AnimationChain.swift +++ b/ChainedAnimation/AnimationChain.swift @@ -8,11 +8,11 @@ public struct AnimationChain { - let options: UIViewAnimationOptions + let options: UIView.AnimationOptions var animations: [[AnimationConfiguration]] var currentOffset: TimeInterval - init(options: UIViewAnimationOptions, animations: [[AnimationConfiguration]], currentOffset : TimeInterval = 0) { + init(options: UIView.AnimationOptions, animations: [[AnimationConfiguration]], currentOffset : TimeInterval = 0) { self.options = options self.animations = animations self.currentOffset = currentOffset @@ -84,7 +84,7 @@ public struct AnimationChain { public func chainAfterCompletion( _ duration: TimeInterval, delay: TimeInterval = 0, - options: UIViewAnimationOptions = [], + options: UIView.AnimationOptions = [], animations newAnimations: @escaping Animation ) -> AnimationChain { @@ -145,7 +145,7 @@ extension UIView { public class func beginAnimationChain( _ duration: TimeInterval, delay: TimeInterval = 0, - options: UIViewAnimationOptions = [], + options: UIView.AnimationOptions = [], animations: @escaping Animation ) -> AnimationChain { diff --git a/ChainedAnimation/AnimationConfiguration.swift b/ChainedAnimation/AnimationConfiguration.swift index fc5d6bc..ca60a60 100644 --- a/ChainedAnimation/AnimationConfiguration.swift +++ b/ChainedAnimation/AnimationConfiguration.swift @@ -12,10 +12,10 @@ struct AnimationConfiguration { let animation: Animation let duration: TimeInterval let delay: TimeInterval - let options: UIViewAnimationOptions + let options: UIView.AnimationOptions var completion : Completion? - init(_ animation: @escaping Animation, duration: TimeInterval, delay: TimeInterval, options: UIViewAnimationOptions = [], completion: Completion? = nil) { + init(_ animation: @escaping Animation, duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions = [], completion: Completion? = nil) { self.animation = animation self.duration = duration self.delay = delay diff --git a/ChainedAnimation/AnimationProvider.swift b/ChainedAnimation/AnimationProvider.swift index f63a87e..0de799f 100644 --- a/ChainedAnimation/AnimationProvider.swift +++ b/ChainedAnimation/AnimationProvider.swift @@ -9,14 +9,14 @@ public protocol AnimationProvider { - func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIViewAnimationOptions, animations: @escaping Animation, completion: Completion?) + func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions, animations: @escaping Animation, completion: Completion?) } struct UIViewAnimationProvider: AnimationProvider { - func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIViewAnimationOptions, animations: @escaping Animation, completion: Completion?) { + func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions, animations: @escaping Animation, completion: Completion?) { UIView.animate( withDuration: duration, delay: delay, diff --git a/ChainedAnimationTests/ChainedAnimationTests.swift b/ChainedAnimationTests/ChainedAnimationTests.swift index 22d43f6..b916ebf 100644 --- a/ChainedAnimationTests/ChainedAnimationTests.swift +++ b/ChainedAnimationTests/ChainedAnimationTests.swift @@ -38,7 +38,7 @@ class ChainedAnimationTests: ChainedAnimationTestCase { } func testCompletionCalled() { - UIView.beginAnimationChain(2, delay: 0, options: UIViewAnimationOptions.curveEaseInOut) { + UIView.beginAnimationChain(2, delay: 0, options: UIView.AnimationOptions.curveEaseInOut) { }.completion { success in XCTAssert(success) }.animate() diff --git a/ChainedAnimationTests/MockAnimationProvider.swift b/ChainedAnimationTests/MockAnimationProvider.swift index a073004..3d1dce8 100644 --- a/ChainedAnimationTests/MockAnimationProvider.swift +++ b/ChainedAnimationTests/MockAnimationProvider.swift @@ -12,7 +12,7 @@ import ChainedAnimation typealias AnimationParameters = ( duration: TimeInterval, delay: TimeInterval, - options: UIViewAnimationOptions, + options: UIView.AnimationOptions, animations: Animation, completion: Completion? ) @@ -47,7 +47,7 @@ class MockAnimationProvider: AnimationProvider { var callPassedInClosures = false - public func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIViewAnimationOptions, animations: @escaping Animation, completion: Completion?) { + public func animate(withDuration duration: TimeInterval, delay: TimeInterval, options: UIView.AnimationOptions, animations: @escaping Animation, completion: Completion?) { callCount += 1 let parameters = (duration: duration, delay: delay, options: options, animations: animations, completion: completion) callParameters = parameters