Skip to content

Commit 205dfd4

Browse files
committed
Updated all examples in chapter-motion to Swift 2.0 (Xcode 7)
1 parent 002a567 commit 205dfd4

File tree

44 files changed

+305
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+305
-83
lines changed

chapter-motion/Detecting Shakes on an iOS Device/Detecting Shakes on an iOS Device.xcodeproj/project.pbxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
A6378A041977C19800D19505 /* Project object */ = {
154154
isa = PBXProject;
155155
attributes = {
156-
LastUpgradeCheck = 0600;
156+
LastSwiftUpdateCheck = 0700;
157+
LastUpgradeCheck = 0700;
157158
ORGANIZATIONNAME = "Pixolity Ltd.";
158159
TargetAttributes = {
159160
A6378A0B1977C19800D19505 = {
@@ -263,6 +264,7 @@
263264
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
264265
COPY_PHASE_STRIP = NO;
265266
ENABLE_STRICT_OBJC_MSGSEND = YES;
267+
ENABLE_TESTABILITY = YES;
266268
GCC_C_LANGUAGE_STANDARD = gnu99;
267269
GCC_DYNAMIC_NO_PIC = NO;
268270
GCC_OPTIMIZATION_LEVEL = 0;
@@ -329,6 +331,7 @@
329331
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
330332
INFOPLIST_FILE = "Detecting Shakes on an iOS Device/Info.plist";
331333
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
334+
PRODUCT_BUNDLE_IDENTIFIER = "com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}";
332335
PRODUCT_NAME = "$(TARGET_NAME)";
333336
};
334337
name = Debug;
@@ -340,6 +343,7 @@
340343
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
341344
INFOPLIST_FILE = "Detecting Shakes on an iOS Device/Info.plist";
342345
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
346+
PRODUCT_BUNDLE_IDENTIFIER = "com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}";
343347
PRODUCT_NAME = "$(TARGET_NAME)";
344348
};
345349
name = Release;
@@ -358,6 +362,7 @@
358362
);
359363
INFOPLIST_FILE = "Detecting Shakes on an iOS DeviceTests/Info.plist";
360364
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
365+
PRODUCT_BUNDLE_IDENTIFIER = "com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}";
361366
PRODUCT_NAME = "$(TARGET_NAME)";
362367
TEST_HOST = "$(BUNDLE_LOADER)";
363368
};
@@ -373,6 +378,7 @@
373378
);
374379
INFOPLIST_FILE = "Detecting Shakes on an iOS DeviceTests/Info.plist";
375380
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
381+
PRODUCT_BUNDLE_IDENTIFIER = "com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}";
376382
PRODUCT_NAME = "$(TARGET_NAME)";
377383
TEST_HOST = "$(BUNDLE_LOADER)";
378384
};
@@ -397,6 +403,7 @@
397403
A6378A2A1977C19900D19505 /* Release */,
398404
);
399405
defaultConfigurationIsVisible = 0;
406+
defaultConfigurationName = Release;
400407
};
401408
A6378A2B1977C19900D19505 /* Build configuration list for PBXNativeTarget "Detecting Shakes on an iOS DeviceTests" */ = {
402409
isa = XCConfigurationList;
@@ -405,6 +412,7 @@
405412
A6378A2D1977C19900D19505 /* Release */,
406413
);
407414
defaultConfigurationIsVisible = 0;
415+
defaultConfigurationName = Release;
408416
};
409417
/* End XCConfigurationList section */
410418
};

chapter-motion/Detecting Shakes on an iOS Device/Detecting Shakes on an iOS Device.xcodeproj/xcuserdata/vandadnp.xcuserdatad/xcschemes/Detecting Shakes on an iOS Device.xcscheme

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0600"
3+
LastUpgradeVersion = "0700"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -48,6 +48,8 @@
4848
ReferencedContainer = "container:Detecting Shakes on an iOS Device.xcodeproj">
4949
</BuildableReference>
5050
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
5153
</TestAction>
5254
<LaunchAction
5355
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
@@ -57,8 +59,10 @@
5759
buildConfiguration = "Debug"
5860
ignoresPersistentStateOnLaunch = "NO"
5961
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
6063
allowLocationSimulation = "YES">
61-
<BuildableProductRunnable>
64+
<BuildableProductRunnable
65+
runnableDebuggingMode = "0">
6266
<BuildableReference
6367
BuildableIdentifier = "primary"
6468
BlueprintIdentifier = "A6378A0B1977C19800D19505"
@@ -76,7 +80,8 @@
7680
useCustomWorkingDirectory = "NO"
7781
buildConfiguration = "Release"
7882
debugDocumentVersioning = "YES">
79-
<BuildableProductRunnable>
83+
<BuildableProductRunnable
84+
runnableDebuggingMode = "0">
8085
<BuildableReference
8186
BuildableIdentifier = "primary"
8287
BlueprintIdentifier = "A6378A0B1977C19800D19505"

chapter-motion/Detecting Shakes on an iOS Device/Detecting Shakes on an iOS Device/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>${EXECUTABLE_NAME}</string>
99
<key>CFBundleIdentifier</key>
10-
<string>com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

chapter-motion/Detecting Shakes on an iOS Device/Detecting Shakes on an iOS Device/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ class ViewController: UIViewController {
1212

1313
/* 1 */
1414
// override func motionEnded(motion: UIEventSubtype,
15-
// withEvent event: UIEvent) {
15+
// withEvent event: UIEvent?) {
1616
//
1717
// /* Handle the motion here */
1818
//
1919
// }
2020

2121
/* 2 */
2222
override func motionEnded(motion: UIEventSubtype,
23-
withEvent event: UIEvent) {
23+
withEvent event: UIEvent?) {
2424

2525
if motion == .MotionShake{
2626
let controller = UIAlertController(title: "Shake",

chapter-motion/Detecting Shakes on an iOS Device/Detecting Shakes on an iOS DeviceTests/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>${EXECUTABLE_NAME}</string>
99
<key>CFBundleIdentifier</key>
10-
<string>com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

chapter-motion/Detecting the Availability of a Gyroscope/Detecting the Availability of a Gyroscope.xcodeproj/project.pbxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
A63789AE1977BE3400D19505 /* Project object */ = {
154154
isa = PBXProject;
155155
attributes = {
156-
LastUpgradeCheck = 0600;
156+
LastSwiftUpdateCheck = 0700;
157+
LastUpgradeCheck = 0700;
157158
ORGANIZATIONNAME = "Pixolity Ltd.";
158159
TargetAttributes = {
159160
A63789B51977BE3400D19505 = {
@@ -263,6 +264,7 @@
263264
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
264265
COPY_PHASE_STRIP = NO;
265266
ENABLE_STRICT_OBJC_MSGSEND = YES;
267+
ENABLE_TESTABILITY = YES;
266268
GCC_C_LANGUAGE_STANDARD = gnu99;
267269
GCC_DYNAMIC_NO_PIC = NO;
268270
GCC_OPTIMIZATION_LEVEL = 0;
@@ -329,6 +331,7 @@
329331
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
330332
INFOPLIST_FILE = "Detecting the Availability of a Gyroscope/Info.plist";
331333
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
334+
PRODUCT_BUNDLE_IDENTIFIER = "com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}";
332335
PRODUCT_NAME = "$(TARGET_NAME)";
333336
};
334337
name = Debug;
@@ -340,6 +343,7 @@
340343
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
341344
INFOPLIST_FILE = "Detecting the Availability of a Gyroscope/Info.plist";
342345
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
346+
PRODUCT_BUNDLE_IDENTIFIER = "com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}";
343347
PRODUCT_NAME = "$(TARGET_NAME)";
344348
};
345349
name = Release;
@@ -358,6 +362,7 @@
358362
);
359363
INFOPLIST_FILE = "Detecting the Availability of a GyroscopeTests/Info.plist";
360364
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
365+
PRODUCT_BUNDLE_IDENTIFIER = "com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}";
361366
PRODUCT_NAME = "$(TARGET_NAME)";
362367
TEST_HOST = "$(BUNDLE_LOADER)";
363368
};
@@ -373,6 +378,7 @@
373378
);
374379
INFOPLIST_FILE = "Detecting the Availability of a GyroscopeTests/Info.plist";
375380
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
381+
PRODUCT_BUNDLE_IDENTIFIER = "com.pixolity.ios.${PRODUCT_NAME:rfc1034identifier}";
376382
PRODUCT_NAME = "$(TARGET_NAME)";
377383
TEST_HOST = "$(BUNDLE_LOADER)";
378384
};
@@ -397,6 +403,7 @@
397403
A63789D41977BE3400D19505 /* Release */,
398404
);
399405
defaultConfigurationIsVisible = 0;
406+
defaultConfigurationName = Release;
400407
};
401408
A63789D51977BE3400D19505 /* Build configuration list for PBXNativeTarget "Detecting the Availability of a GyroscopeTests" */ = {
402409
isa = XCConfigurationList;
@@ -405,6 +412,7 @@
405412
A63789D71977BE3400D19505 /* Release */,
406413
);
407414
defaultConfigurationIsVisible = 0;
415+
defaultConfigurationName = Release;
408416
};
409417
/* End XCConfigurationList section */
410418
};

chapter-motion/Detecting the Availability of a Gyroscope/Detecting the Availability of a Gyroscope.xcodeproj/xcuserdata/vandadnp.xcuserdatad/xcschemes/Detecting the Availability of a Gyroscope.xcscheme

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0600"
3+
LastUpgradeVersion = "0700"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -58,6 +58,8 @@
5858
ReferencedContainer = "container:Detecting the Availability of a Gyroscope.xcodeproj">
5959
</BuildableReference>
6060
</MacroExpansion>
61+
<AdditionalOptions>
62+
</AdditionalOptions>
6163
</TestAction>
6264
<LaunchAction
6365
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
@@ -67,8 +69,10 @@
6769
buildConfiguration = "Debug"
6870
ignoresPersistentStateOnLaunch = "NO"
6971
debugDocumentVersioning = "YES"
72+
debugServiceExtension = "internal"
7073
allowLocationSimulation = "YES">
71-
<BuildableProductRunnable>
74+
<BuildableProductRunnable
75+
runnableDebuggingMode = "0">
7276
<BuildableReference
7377
BuildableIdentifier = "primary"
7478
BlueprintIdentifier = "A63789B51977BE3400D19505"
@@ -86,7 +90,8 @@
8690
useCustomWorkingDirectory = "NO"
8791
buildConfiguration = "Release"
8892
debugDocumentVersioning = "YES">
89-
<BuildableProductRunnable>
93+
<BuildableProductRunnable
94+
runnableDebuggingMode = "0">
9095
<BuildableReference
9196
BuildableIdentifier = "primary"
9297
BlueprintIdentifier = "A63789B51977BE3400D19505"

chapter-motion/Detecting the Availability of a Gyroscope/Detecting the Availability of a Gyroscope/AppDelegate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2222
let motionManager = CMMotionManager()
2323

2424
if motionManager.gyroAvailable{
25-
println("Gryro is available")
25+
print("Gryro is available")
2626
} else {
27-
println("Gyro is not available")
27+
print("Gyro is not available")
2828
}
2929

3030
if motionManager.gyroActive{
31-
println("Gryo is active")
31+
print("Gryo is active")
3232
} else {
33-
println("Gryo is not active")
33+
print("Gryo is not active")
3434
}
3535

3636
return true

0 commit comments

Comments
 (0)