Skip to content

Commit 4f7d4c3

Browse files
committed
Updated all code in chapter-notification to Swift 2.0 (Xcode 7)
1 parent 229d313 commit 4f7d4c3

File tree

57 files changed

+198
-93
lines changed

Some content is hidden

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

57 files changed

+198
-93
lines changed

chapter-notification/Delivering Push Notifications to Your App/Delivering Push Notifications to Your App.xcodeproj/project.pbxproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@
156156
A64E38291976565800CCD6A6 /* Project object */ = {
157157
isa = PBXProject;
158158
attributes = {
159-
LastUpgradeCheck = 0600;
159+
LastSwiftUpdateCheck = 0700;
160+
LastUpgradeCheck = 0700;
160161
ORGANIZATIONNAME = "Pixolity Ltd.";
161162
TargetAttributes = {
162163
A64E38301976565800CCD6A6 = {
@@ -267,6 +268,7 @@
267268
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
268269
COPY_PHASE_STRIP = NO;
269270
ENABLE_STRICT_OBJC_MSGSEND = YES;
271+
ENABLE_TESTABILITY = YES;
270272
GCC_C_LANGUAGE_STANDARD = gnu99;
271273
GCC_DYNAMIC_NO_PIC = NO;
272274
GCC_OPTIMIZATION_LEVEL = 0;
@@ -335,6 +337,7 @@
335337
CODE_SIGN_IDENTITY = "iPhone Developer: Vandad Nahavandipoor (J54K6K24Z3)";
336338
INFOPLIST_FILE = "Delivering Push Notifications to Your App/Info.plist";
337339
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
340+
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
338341
PRODUCT_NAME = "$(TARGET_NAME)";
339342
PROVISIONING_PROFILE = "16B110EE-4B5A-4B6C-9D22-9F18B7FFC1FA";
340343
};
@@ -348,6 +351,7 @@
348351
CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/$(TARGET_NAME)/Entitlements.plist";
349352
INFOPLIST_FILE = "Delivering Push Notifications to Your App/Info.plist";
350353
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
354+
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
351355
PRODUCT_NAME = "$(TARGET_NAME)";
352356
PROVISIONING_PROFILE = "16B110EE-4B5A-4B6C-9D22-9F18B7FFC1FA";
353357
};
@@ -367,6 +371,7 @@
367371
);
368372
INFOPLIST_FILE = "Delivering Push Notifications to Your AppTests/Info.plist";
369373
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
374+
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
370375
PRODUCT_NAME = "$(TARGET_NAME)";
371376
TEST_HOST = "$(BUNDLE_LOADER)";
372377
};
@@ -382,6 +387,7 @@
382387
);
383388
INFOPLIST_FILE = "Delivering Push Notifications to Your AppTests/Info.plist";
384389
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
390+
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
385391
PRODUCT_NAME = "$(TARGET_NAME)";
386392
TEST_HOST = "$(BUNDLE_LOADER)";
387393
};

chapter-notification/Delivering Push Notifications to Your App/Delivering Push Notifications to Your App.xcodeproj/xcuserdata/vandadnp.xcuserdatad/xcschemes/Delivering Push Notifications to Your App.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"
@@ -62,6 +62,8 @@
6262
ReferencedContainer = "container:Delivering Push Notifications to Your App.xcodeproj">
6363
</BuildableReference>
6464
</MacroExpansion>
65+
<AdditionalOptions>
66+
</AdditionalOptions>
6567
</TestAction>
6668
<LaunchAction
6769
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
@@ -71,8 +73,10 @@
7173
buildConfiguration = "Debug"
7274
ignoresPersistentStateOnLaunch = "NO"
7375
debugDocumentVersioning = "YES"
76+
debugServiceExtension = "internal"
7477
allowLocationSimulation = "YES">
75-
<BuildableProductRunnable>
78+
<BuildableProductRunnable
79+
runnableDebuggingMode = "0">
7680
<BuildableReference
7781
BuildableIdentifier = "primary"
7882
BlueprintIdentifier = "A64E38301976565800CCD6A6"
@@ -90,7 +94,8 @@
9094
useCustomWorkingDirectory = "NO"
9195
buildConfiguration = "Release"
9296
debugDocumentVersioning = "YES">
93-
<BuildableProductRunnable>
97+
<BuildableProductRunnable
98+
runnableDebuggingMode = "0">
9499
<BuildableReference
95100
BuildableIdentifier = "primary"
96101
BlueprintIdentifier = "A64E38301976565800CCD6A6"

chapter-notification/Delivering Push Notifications to Your App/Delivering Push Notifications to Your App/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1919
/* Each byte in the data will be translated to its hex value like 0x01 or
2020
0xAB excluding the 0x part, so for 1 byte, we will need 2 characters to
2121
represent that byte, hence the * 2 */
22-
var tokenAsString = NSMutableString()
22+
let tokenAsString = NSMutableString()
2323

2424
/* Create a buffer of UInt8 values and then get the raw bytes
2525
of the device token into this buffer */
@@ -31,7 +31,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3131
tokenAsString.appendFormat("%02hhX", byte)
3232
}
3333

34-
println("Token = \(tokenAsString)")
34+
print("Token = \(tokenAsString)")
3535

3636
}
3737

chapter-notification/Delivering Push Notifications to Your App/Delivering Push Notifications to Your App/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.cookbook.app</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

chapter-notification/Delivering Push Notifications to Your App/Delivering Push Notifications to Your AppTests/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.cookbook.app</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

chapter-notification/Handling Local System Notifications/Handling Local System Notifications.xcodeproj/project.pbxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@
156156
A6C28114197555EC008E5568 /* Project object */ = {
157157
isa = PBXProject;
158158
attributes = {
159-
LastUpgradeCheck = 0600;
159+
LastSwiftUpdateCheck = 0700;
160+
LastUpgradeCheck = 0700;
160161
ORGANIZATIONNAME = "Pixolity Ltd.";
161162
TargetAttributes = {
162163
A6C2811B197555EC008E5568 = {
@@ -267,6 +268,7 @@
267268
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
268269
COPY_PHASE_STRIP = NO;
269270
ENABLE_STRICT_OBJC_MSGSEND = YES;
271+
ENABLE_TESTABILITY = YES;
270272
GCC_C_LANGUAGE_STANDARD = gnu99;
271273
GCC_DYNAMIC_NO_PIC = NO;
272274
GCC_OPTIMIZATION_LEVEL = 0;
@@ -333,6 +335,7 @@
333335
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
334336
INFOPLIST_FILE = "Handling Local System Notifications/Info.plist";
335337
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
338+
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
336339
PRODUCT_NAME = "$(TARGET_NAME)";
337340
};
338341
name = Debug;
@@ -344,6 +347,7 @@
344347
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
345348
INFOPLIST_FILE = "Handling Local System Notifications/Info.plist";
346349
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
350+
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
347351
PRODUCT_NAME = "$(TARGET_NAME)";
348352
};
349353
name = Release;
@@ -362,6 +366,7 @@
362366
);
363367
INFOPLIST_FILE = "Handling Local System NotificationsTests/Info.plist";
364368
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
369+
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
365370
PRODUCT_NAME = "$(TARGET_NAME)";
366371
TEST_HOST = "$(BUNDLE_LOADER)";
367372
};
@@ -377,6 +382,7 @@
377382
);
378383
INFOPLIST_FILE = "Handling Local System NotificationsTests/Info.plist";
379384
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
385+
PRODUCT_BUNDLE_IDENTIFIER = com.pixolity.ios.cookbook.app;
380386
PRODUCT_NAME = "$(TARGET_NAME)";
381387
TEST_HOST = "$(BUNDLE_LOADER)";
382388
};
@@ -401,6 +407,7 @@
401407
A6C2813A197555EC008E5568 /* Release */,
402408
);
403409
defaultConfigurationIsVisible = 0;
410+
defaultConfigurationName = Release;
404411
};
405412
A6C2813B197555EC008E5568 /* Build configuration list for PBXNativeTarget "Handling Local System NotificationsTests" */ = {
406413
isa = XCConfigurationList;
@@ -409,6 +416,7 @@
409416
A6C2813D197555EC008E5568 /* Release */,
410417
);
411418
defaultConfigurationIsVisible = 0;
419+
defaultConfigurationName = Release;
412420
};
413421
/* End XCConfigurationList section */
414422
};

chapter-notification/Handling Local System Notifications/Handling Local System Notifications.xcodeproj/xcuserdata/vandadnp.xcuserdatad/xcschemes/Handling Local System Notifications.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"
@@ -62,6 +62,8 @@
6262
ReferencedContainer = "container:Handling Local System Notifications.xcodeproj">
6363
</BuildableReference>
6464
</MacroExpansion>
65+
<AdditionalOptions>
66+
</AdditionalOptions>
6567
</TestAction>
6668
<LaunchAction
6769
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
@@ -71,8 +73,10 @@
7173
buildConfiguration = "Debug"
7274
ignoresPersistentStateOnLaunch = "NO"
7375
debugDocumentVersioning = "YES"
76+
debugServiceExtension = "internal"
7477
allowLocationSimulation = "YES">
75-
<BuildableProductRunnable>
78+
<BuildableProductRunnable
79+
runnableDebuggingMode = "0">
7680
<BuildableReference
7781
BuildableIdentifier = "primary"
7882
BlueprintIdentifier = "A6C2811B197555EC008E5568"
@@ -90,7 +94,8 @@
9094
useCustomWorkingDirectory = "NO"
9195
buildConfiguration = "Release"
9296
debugDocumentVersioning = "YES">
93-
<BuildableProductRunnable>
97+
<BuildableProductRunnable
98+
runnableDebuggingMode = "0">
9499
<BuildableReference
95100
BuildableIdentifier = "primary"
96101
BlueprintIdentifier = "A6C2811B197555EC008E5568"

chapter-notification/Handling Local System Notifications/Handling Local System Notifications/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1515

1616
func handleSettingsChanged(notification: NSNotification){
1717

18-
println("Settings changed")
18+
print("Settings changed")
1919

2020
if let object:AnyObject = notification.object{
21-
println("Notification Object = \(object)")
21+
print("Notification Object = \(object)")
2222
}
2323

2424
}

0 commit comments

Comments
 (0)