Skip to content

Commit 1dce31a

Browse files
committed
[UPDATE] Migrate to Swift 3.0
1 parent de1f47d commit 1dce31a

File tree

6 files changed

+133
-124
lines changed

6 files changed

+133
-124
lines changed

Example/JDAnimationKit.xcodeproj/project.pbxproj

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@
158158
isa = PBXNativeTarget;
159159
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JDAnimationKit_Example" */;
160160
buildPhases = (
161-
9AEF00E6992DDDE705363D54 /* Check Pods Manifest.lock */,
161+
9AEF00E6992DDDE705363D54 /* [CP] Check Pods Manifest.lock */,
162162
607FACCC1AFB9204008FA782 /* Sources */,
163163
607FACCD1AFB9204008FA782 /* Frameworks */,
164164
607FACCE1AFB9204008FA782 /* Resources */,
165-
52C1E04C2A2149429F554167 /* Embed Pods Frameworks */,
166-
F53BF809A5C2E2FF97469218 /* Copy Pods Resources */,
165+
52C1E04C2A2149429F554167 /* [CP] Embed Pods Frameworks */,
166+
F53BF809A5C2E2FF97469218 /* [CP] Copy Pods Resources */,
167167
);
168168
buildRules = (
169169
);
@@ -199,14 +199,16 @@
199199
isa = PBXProject;
200200
attributes = {
201201
LastSwiftUpdateCheck = 0720;
202-
LastUpgradeCheck = 0720;
202+
LastUpgradeCheck = 0810;
203203
ORGANIZATIONNAME = CocoaPods;
204204
TargetAttributes = {
205205
607FACCF1AFB9204008FA782 = {
206206
CreatedOnToolsVersion = 6.3.1;
207+
LastSwiftMigration = 0810;
207208
};
208209
607FACE41AFB9204008FA782 = {
209210
CreatedOnToolsVersion = 6.3.1;
211+
LastSwiftMigration = 0810;
210212
TestTargetID = 607FACCF1AFB9204008FA782;
211213
};
212214
};
@@ -251,44 +253,44 @@
251253
/* End PBXResourcesBuildPhase section */
252254

253255
/* Begin PBXShellScriptBuildPhase section */
254-
52C1E04C2A2149429F554167 /* Embed Pods Frameworks */ = {
256+
52C1E04C2A2149429F554167 /* [CP] Embed Pods Frameworks */ = {
255257
isa = PBXShellScriptBuildPhase;
256258
buildActionMask = 2147483647;
257259
files = (
258260
);
259261
inputPaths = (
260262
);
261-
name = "Embed Pods Frameworks";
263+
name = "[CP] Embed Pods Frameworks";
262264
outputPaths = (
263265
);
264266
runOnlyForDeploymentPostprocessing = 0;
265267
shellPath = /bin/sh;
266268
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JDAnimationKit_Example/Pods-JDAnimationKit_Example-frameworks.sh\"\n";
267269
showEnvVarsInLog = 0;
268270
};
269-
9AEF00E6992DDDE705363D54 /* Check Pods Manifest.lock */ = {
271+
9AEF00E6992DDDE705363D54 /* [CP] Check Pods Manifest.lock */ = {
270272
isa = PBXShellScriptBuildPhase;
271273
buildActionMask = 2147483647;
272274
files = (
273275
);
274276
inputPaths = (
275277
);
276-
name = "Check Pods Manifest.lock";
278+
name = "[CP] Check Pods Manifest.lock";
277279
outputPaths = (
278280
);
279281
runOnlyForDeploymentPostprocessing = 0;
280282
shellPath = /bin/sh;
281-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
283+
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";
282284
showEnvVarsInLog = 0;
283285
};
284-
F53BF809A5C2E2FF97469218 /* Copy Pods Resources */ = {
286+
F53BF809A5C2E2FF97469218 /* [CP] Copy Pods Resources */ = {
285287
isa = PBXShellScriptBuildPhase;
286288
buildActionMask = 2147483647;
287289
files = (
288290
);
289291
inputPaths = (
290292
);
291-
name = "Copy Pods Resources";
293+
name = "[CP] Copy Pods Resources";
292294
outputPaths = (
293295
);
294296
runOnlyForDeploymentPostprocessing = 0;
@@ -359,8 +361,10 @@
359361
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
360362
CLANG_WARN_EMPTY_BODY = YES;
361363
CLANG_WARN_ENUM_CONVERSION = YES;
364+
CLANG_WARN_INFINITE_RECURSION = YES;
362365
CLANG_WARN_INT_CONVERSION = YES;
363366
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
367+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
364368
CLANG_WARN_UNREACHABLE_CODE = YES;
365369
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
366370
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -404,8 +408,10 @@
404408
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
405409
CLANG_WARN_EMPTY_BODY = YES;
406410
CLANG_WARN_ENUM_CONVERSION = YES;
411+
CLANG_WARN_INFINITE_RECURSION = YES;
407412
CLANG_WARN_INT_CONVERSION = YES;
408413
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
414+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
409415
CLANG_WARN_UNREACHABLE_CODE = YES;
410416
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
411417
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -424,6 +430,7 @@
424430
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
425431
MTL_ENABLE_DEBUG_INFO = NO;
426432
SDKROOT = iphoneos;
433+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
427434
VALIDATE_PRODUCT = YES;
428435
};
429436
name = Release;
@@ -432,6 +439,7 @@
432439
isa = XCBuildConfiguration;
433440
baseConfigurationReference = A7CEF63097A766D922929D04 /* Pods-JDAnimationKit_Example.debug.xcconfig */;
434441
buildSettings = {
442+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
435443
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
436444
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
437445
INFOPLIST_FILE = JDAnimationKit/Info.plist;
@@ -440,13 +448,15 @@
440448
MODULE_NAME = ExampleApp;
441449
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
442450
PRODUCT_NAME = "$(TARGET_NAME)";
451+
SWIFT_VERSION = 3.0;
443452
};
444453
name = Debug;
445454
};
446455
607FACF11AFB9204008FA782 /* Release */ = {
447456
isa = XCBuildConfiguration;
448457
baseConfigurationReference = 3C662A544AF88C499E2238E5 /* Pods-JDAnimationKit_Example.release.xcconfig */;
449458
buildSettings = {
459+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
450460
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
451461
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
452462
INFOPLIST_FILE = JDAnimationKit/Info.plist;
@@ -455,6 +465,7 @@
455465
MODULE_NAME = ExampleApp;
456466
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
457467
PRODUCT_NAME = "$(TARGET_NAME)";
468+
SWIFT_VERSION = 3.0;
458469
};
459470
name = Release;
460471
};
@@ -474,6 +485,7 @@
474485
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
475486
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
476487
PRODUCT_NAME = "$(TARGET_NAME)";
488+
SWIFT_VERSION = 3.0;
477489
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JDAnimationKit_Example.app/JDAnimationKit_Example";
478490
};
479491
name = Debug;
@@ -490,6 +502,7 @@
490502
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
491503
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
492504
PRODUCT_NAME = "$(TARGET_NAME)";
505+
SWIFT_VERSION = 3.0;
493506
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JDAnimationKit_Example.app/JDAnimationKit_Example";
494507
};
495508
name = Release;

Example/JDAnimationKit.xcodeproj/xcshareddata/xcschemes/JDAnimationKit-Example.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0720"
3+
LastUpgradeVersion = "0810"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Example/JDAnimationKit/AppDelegate.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
1919
return true
2020
}
2121

22-
func applicationWillResignActive(application: UIApplication) {
22+
func applicationWillResignActive(_ application: UIApplication) {
2323
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
2424
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
2525
}
2626

27-
func applicationDidEnterBackground(application: UIApplication) {
27+
func applicationDidEnterBackground(_ application: UIApplication) {
2828
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
2929
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
3030
}
3131

32-
func applicationWillEnterForeground(application: UIApplication) {
32+
func applicationWillEnterForeground(_ application: UIApplication) {
3333
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
3434
}
3535

36-
func applicationDidBecomeActive(application: UIApplication) {
36+
func applicationDidBecomeActive(_ application: UIApplication) {
3737
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
3838
}
3939

40-
func applicationWillTerminate(application: UIApplication) {
40+
func applicationWillTerminate(_ application: UIApplication) {
4141
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
4242
}
4343

Example/JDAnimationKit/ViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ class ViewController: UIViewController {
2323
// Dispose of any resources that can be recreated.
2424
}
2525

26-
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
26+
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
2727

2828
var frame = self.squareView.frame
2929
frame.size.width = frame.height
3030

3131
self.squareView.changeAnchorPoint(0, y: 0.5)
3232
.changeBounds(frame, spring: true)
33-
.changeBgColor(UIColor.greenColor())
33+
.changeBgColor(UIColor.green)
3434
.changeAnchorPoint(0, y: 0, delay: 0.6)
3535
.rotateTo(60, spring: true, springConfig: JDSpringConfig(bounciness: 20, speed: 10), delay:0.7)
3636
.didStopAnimation { (node, key, finished, error) -> Void in
3737

3838
if finished == true{
39-
self.squareView.moveYTo(1000, duration: 0.8, timing: .EaseIn).opacityTo(0, duration: 1)
39+
self.squareView.moveYTo(1000, duration: 0.8, timing: .easeIn).opacityTo(0, duration: 1)
4040
}
4141
}
4242
}

Example/Tests/Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Tests: XCTestCase {
2020

2121
func testPerformanceExample() {
2222
// This is an example of a performance test case.
23-
self.measureBlock() {
23+
self.measure() {
2424
// Put the code you want to measure the time of here.
2525
}
2626
}

0 commit comments

Comments
 (0)