Skip to content

Commit

Permalink
Update Swift version to 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
daehn committed Oct 19, 2018
1 parent b688f59 commit 513547e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 21 deletions.
16 changes: 11 additions & 5 deletions ChainedAnimation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -396,13 +396,15 @@
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;
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;
Expand Down Expand Up @@ -457,13 +459,15 @@
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;
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;
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,9 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down Expand Up @@ -57,7 +56,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
8 changes: 4 additions & 4 deletions ChainedAnimation/AnimationChain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {

Expand Down Expand Up @@ -145,7 +145,7 @@ extension UIView {
public class func beginAnimationChain(
_ duration: TimeInterval,
delay: TimeInterval = 0,
options: UIViewAnimationOptions = [],
options: UIView.AnimationOptions = [],
animations: @escaping Animation
) -> AnimationChain {

Expand Down
4 changes: 2 additions & 2 deletions ChainedAnimation/AnimationConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ChainedAnimation/AnimationProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ChainedAnimationTests/ChainedAnimationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions ChainedAnimationTests/MockAnimationProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ChainedAnimation
typealias AnimationParameters = (
duration: TimeInterval,
delay: TimeInterval,
options: UIViewAnimationOptions,
options: UIView.AnimationOptions,
animations: Animation,
completion: Completion?
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 513547e

Please sign in to comment.