Skip to content

Commit

Permalink
Convert to swift 4
Browse files Browse the repository at this point in the history
  • Loading branch information
modzelewski committed Jun 29, 2017
1 parent 3ddac7d commit 2d409cb
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 21 deletions.
25 changes: 24 additions & 1 deletion Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Sources/ease/Elastic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public extension Ease {
if t == 1 { return b + c }
let p = d * 0.3
let s = p / 4;
return -(c * pow(2, 10 * (t - 1)) * sin((t * d - s) * (2 * M_PI) / p)) + b
return -(c * pow(2, 10 * (t - 1)) * sin((t * d - s) * (2 * .pi) / p)) + b
}

/// Ease out
Expand All @@ -26,7 +26,7 @@ public extension Ease {
if t == 1 { return b + c }
let p = d * 0.3
let s = p / 4;
return c * pow(2, -10 * t) * sin((t * d - s) * (2 * M_PI) / p) + c + b
return c * pow(2, -10 * t) * sin((t * d - s) * (2 * .pi) / p) + c + b
}

/// Ease in out
Expand All @@ -38,9 +38,9 @@ public extension Ease {
let p = d * 0.45
let s = p / 4
if t < 1 {
return -0.5 * (c * pow(2, 10 * (t - 1)) * sin(((t - 1) * d - s) * (M_PI * 2) / p)) + b
return -0.5 * (c * pow(2, 10 * (t - 1)) * sin(((t - 1) * d - s) * (.pi * 2) / p)) + b
}
return c * pow(2, -10 * (t - 1)) * sin(((t - 1) * d - s) * (M_PI * 2) / p) * 0.5 + c + b
return c * pow(2, -10 * (t - 1)) * sin(((t - 1) * d - s) * (.pi * 2) / p) * 0.5 + c + b
}

}
Expand Down
8 changes: 4 additions & 4 deletions Sources/ease/Sin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ public extension Ease {
/// Ease in
public static let easeIn: TimingFunction = {
t, b, c, d in
return -c * cos(t / d * M_PI_2) + c + b
return -c * cos(t / d * .pi / 2) + c + b
}

/// Ease out
public static let easeOut: TimingFunction = {
t, b, c, d in
return c * sin(t / d * M_PI_2) + b
return c * sin(t / d * .pi / 2) + b
}

/// Ease in out
public static let easeInOut: TimingFunction = {
t, b, c, d in
return -c / 2 * (cos(M_PI * t / d) - 1) + b
return -c / 2 * (cos(.pi * t / d) - 1) + b
}

}

}
}
34 changes: 25 additions & 9 deletions TRX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -527,15 +527,15 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0900;
TargetAttributes = {
663E81401D45FC6F00130EB5 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 0900;
};
667AEFA11D460530004E291C = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 0900;
};
667AEFD21D460A7D004E291C = {
CreatedOnToolsVersion = 7.3.1;
Expand Down Expand Up @@ -798,7 +798,8 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -851,7 +852,8 @@
PRODUCT_NAME = TRX;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -912,7 +914,8 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -965,7 +968,8 @@
PRODUCT_NAME = TRX;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
Expand All @@ -978,7 +982,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 4FDB8A670D5D07A4F7D81EBC /* Pods-TRXTests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -1031,7 +1035,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 35D73B81CBB1F61CC6AB06ED /* Pods-TRXTests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -1076,12 +1080,18 @@
66D55E921D45FA7400A4DA1C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -1101,12 +1111,18 @@
66D55E931D45FA7400A4DA1C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down
4 changes: 3 additions & 1 deletion TRX.xcodeproj/xcshareddata/xcschemes/TRXTests.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -10,6 +10,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -30,6 +31,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
4 changes: 3 additions & 1 deletion TRX.xcodeproj/xcshareddata/xcschemes/TRXiOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -45,6 +46,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
4 changes: 3 additions & 1 deletion TRX.xcodeproj/xcshareddata/xcschemes/TRXtvOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -45,6 +46,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down

0 comments on commit 2d409cb

Please sign in to comment.