Skip to content

Commit 7b4fe30

Browse files
committed
starting revision of dialogs chapter examples
1 parent 8108405 commit 7b4fe30

File tree

18 files changed

+220
-123
lines changed

18 files changed

+220
-123
lines changed

bk2ch13p620dialogsOniPhone/ch26p888dialogsOniPhone.xcodeproj/project.pbxproj

+13-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -100,7 +100,7 @@
100100
};
101101
};
102102
buildConfigurationList = C92977361821C4DB00EF834C /* Build configuration list for PBXProject "ch26p888dialogsOniPhone" */;
103-
compatibilityVersion = "Xcode 3.2";
103+
compatibilityVersion = "Xcode 9.3";
104104
developmentRegion = English;
105105
hasScannedForEncodings = 0;
106106
knownRegions = (
@@ -263,8 +263,12 @@
263263
GCC_PRECOMPILE_PREFIX_HEADER = YES;
264264
GCC_PREFIX_HEADER = "ch26p888dialogsOniPhone/ch26p888dialogsOniPhone-Prefix.pch";
265265
INFOPLIST_FILE = "ch26p888dialogsOniPhone/ch26p888dialogsOniPhone-Info.plist";
266-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
267-
ONLY_ACTIVE_ARCH = NO;
266+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
267+
LD_RUNPATH_SEARCH_PATHS = (
268+
"$(inherited)",
269+
"@executable_path/Frameworks",
270+
);
271+
ONLY_ACTIVE_ARCH = YES;
268272
PRODUCT_BUNDLE_IDENTIFIER = "com.neuburg.matt.${PRODUCT_NAME:rfc1034identifier}";
269273
PRODUCT_NAME = "$(TARGET_NAME)";
270274
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -282,7 +286,11 @@
282286
GCC_PRECOMPILE_PREFIX_HEADER = YES;
283287
GCC_PREFIX_HEADER = "ch26p888dialogsOniPhone/ch26p888dialogsOniPhone-Prefix.pch";
284288
INFOPLIST_FILE = "ch26p888dialogsOniPhone/ch26p888dialogsOniPhone-Info.plist";
285-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
289+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
290+
LD_RUNPATH_SEARCH_PATHS = (
291+
"$(inherited)",
292+
"@executable_path/Frameworks",
293+
);
286294
ONLY_ACTIVE_ARCH = NO;
287295
PRODUCT_BUNDLE_IDENTIFIER = "com.neuburg.matt.${PRODUCT_NAME:rfc1034identifier}";
288296
PRODUCT_NAME = "$(TARGET_NAME)";

bk2ch13p620dialogsOniPhone/ch26p888dialogsOniPhone/ViewController.swift

+12-15
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ extension UIResponder {
1515
}
1616
}
1717

18-
// all greatly changed in iOS 8 and much for the better in my humble opinion
19-
2018
class ViewController: UIViewController, UITextFieldDelegate {
2119

2220
var alertString = ""
@@ -89,20 +87,19 @@ class ViewController: UIViewController, UITextFieldDelegate {
8987
// =====
9088

9189
@IBAction func doActionSheet(_ sender: Any) {
92-
let action = UIAlertController(title: "Choose New Layout", message: nil, preferredStyle: .actionSheet)
93-
action.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: {_ in print("Cancel")}))
90+
let alert = UIAlertController(title: "Not So Fast!",
91+
message: """
92+
Do you really want to do this \
93+
tremendously destructive thing?
94+
""",
95+
preferredStyle: .actionSheet)
9496
func handler(_ act:UIAlertAction) {
95-
print(act.title as Any)
96-
}
97-
for s in ["3 by 3", "4 by 3", "4 by 4", "5 by 4", "5 by 5"] {
98-
action.addAction(UIAlertAction(title: s, style: .default, handler: handler))
99-
}
100-
// action.view.tintColor = .yellow
101-
self.present(action, animated: true)
102-
if let pop = action.popoverPresentationController {
103-
let v = sender as! UIView
104-
pop.sourceView = v
105-
pop.sourceRect = v.bounds
97+
print("User tapped \(act.title as Any)")
10698
}
99+
// illustrating the three button styles
100+
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: handler))
101+
alert.addAction(UIAlertAction(title: "Just Do It!", style: .destructive, handler: handler))
102+
alert.addAction(UIAlertAction(title: "Maybe", style: .default, handler: handler))
103+
self.present(alert, animated: true)
107104
}
108105
}

bk2ch13p624actionSheetPopovers/ch26p892actionSheetPopovers.xcodeproj/project.pbxproj

+13-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -106,7 +106,7 @@
106106
};
107107
};
108108
buildConfigurationList = C92977B91821DCB300EF834C /* Build configuration list for PBXProject "ch26p892actionSheetPopovers" */;
109-
compatibilityVersion = "Xcode 3.2";
109+
compatibilityVersion = "Xcode 9.3";
110110
developmentRegion = English;
111111
hasScannedForEncodings = 0;
112112
knownRegions = (
@@ -273,9 +273,12 @@
273273
GCC_PRECOMPILE_PREFIX_HEADER = YES;
274274
GCC_PREFIX_HEADER = "ch26p892actionSheetPopovers/ch26p892actionSheetPopovers-Prefix.pch";
275275
INFOPLIST_FILE = "ch26p892actionSheetPopovers/ch26p892actionSheetPopovers-Info.plist";
276-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
277-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
278-
ONLY_ACTIVE_ARCH = NO;
276+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
277+
LD_RUNPATH_SEARCH_PATHS = (
278+
"$(inherited)",
279+
"@executable_path/Frameworks",
280+
);
281+
ONLY_ACTIVE_ARCH = YES;
279282
PRODUCT_BUNDLE_IDENTIFIER = "com.neuburg.matt.${PRODUCT_NAME:rfc1034identifier}";
280283
PRODUCT_NAME = "$(TARGET_NAME)";
281284
SWIFT_OBJC_BRIDGING_HEADER = "";
@@ -293,8 +296,11 @@
293296
GCC_PRECOMPILE_PREFIX_HEADER = YES;
294297
GCC_PREFIX_HEADER = "ch26p892actionSheetPopovers/ch26p892actionSheetPopovers-Prefix.pch";
295298
INFOPLIST_FILE = "ch26p892actionSheetPopovers/ch26p892actionSheetPopovers-Info.plist";
296-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
297-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
299+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
300+
LD_RUNPATH_SEARCH_PATHS = (
301+
"$(inherited)",
302+
"@executable_path/Frameworks",
303+
);
298304
ONLY_ACTIVE_ARCH = NO;
299305
PRODUCT_BUNDLE_IDENTIFIER = "com.neuburg.matt.${PRODUCT_NAME:rfc1034identifier}";
300306
PRODUCT_NAME = "$(TARGET_NAME)";

bk2ch13p630localNotification/CoffeeTime.xcodeproj/project.pbxproj

+29-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -201,7 +201,7 @@
201201
};
202202
};
203203
buildConfigurationList = C97D40991822A259002DFE75 /* Build configuration list for PBXProject "CoffeeTime" */;
204-
compatibilityVersion = "Xcode 3.2";
204+
compatibilityVersion = "Xcode 9.3";
205205
developmentRegion = English;
206206
hasScannedForEncodings = 0;
207207
knownRegions = (
@@ -300,14 +300,20 @@
300300
CLANG_WARN_INFINITE_RECURSION = YES;
301301
CLANG_WARN_SUSPICIOUS_MOVES = YES;
302302
CLANG_WARN_UNREACHABLE_CODE = YES;
303+
CURRENT_PROJECT_VERSION = 1.0;
303304
DEBUG_INFORMATION_FORMAT = dwarf;
304305
DEVELOPMENT_TEAM = W3LHX5RGV2;
305306
ENABLE_STRICT_OBJC_MSGSEND = YES;
306307
ENABLE_TESTABILITY = YES;
307308
GCC_NO_COMMON_BLOCKS = YES;
308309
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
309310
INFOPLIST_FILE = CoffeeTimeNotificationUI/Info.plist;
310-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
311+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
312+
LD_RUNPATH_SEARCH_PATHS = (
313+
"$(inherited)",
314+
"@executable_path/Frameworks",
315+
"@executable_path/../../Frameworks",
316+
);
311317
MTL_ENABLE_DEBUG_INFO = YES;
312318
PRODUCT_BUNDLE_IDENTIFIER = com.neuburg.matt.CoffeeTime.CoffeeTimeNotificationUI;
313319
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -328,18 +334,25 @@
328334
CLANG_WARN_SUSPICIOUS_MOVES = YES;
329335
CLANG_WARN_UNREACHABLE_CODE = YES;
330336
COPY_PHASE_STRIP = NO;
337+
CURRENT_PROJECT_VERSION = 1.0;
331338
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
332339
DEVELOPMENT_TEAM = W3LHX5RGV2;
333340
ENABLE_STRICT_OBJC_MSGSEND = YES;
334341
GCC_NO_COMMON_BLOCKS = YES;
335342
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
336343
INFOPLIST_FILE = CoffeeTimeNotificationUI/Info.plist;
337-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
344+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
345+
LD_RUNPATH_SEARCH_PATHS = (
346+
"$(inherited)",
347+
"@executable_path/Frameworks",
348+
"@executable_path/../../Frameworks",
349+
);
338350
MTL_ENABLE_DEBUG_INFO = NO;
339351
PRODUCT_BUNDLE_IDENTIFIER = com.neuburg.matt.CoffeeTime.CoffeeTimeNotificationUI;
340352
PRODUCT_NAME = "$(TARGET_NAME)";
341353
SKIP_INSTALL = YES;
342-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
354+
SWIFT_COMPILATION_MODE = wholemodule;
355+
SWIFT_OPTIMIZATION_LEVEL = "-O";
343356
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
344357
SWIFT_VERSION = 5.0;
345358
};
@@ -455,9 +468,12 @@
455468
GCC_PRECOMPILE_PREFIX_HEADER = YES;
456469
GCC_PREFIX_HEADER = "ch26p899localNotification/CoffeeTime-Prefix.pch";
457470
INFOPLIST_FILE = "ch26p899localNotification/CoffeeTime-Info.plist";
458-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
459-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
460-
ONLY_ACTIVE_ARCH = NO;
471+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
472+
LD_RUNPATH_SEARCH_PATHS = (
473+
"$(inherited)",
474+
"@executable_path/Frameworks",
475+
);
476+
ONLY_ACTIVE_ARCH = YES;
461477
PRODUCT_BUNDLE_IDENTIFIER = "com.neuburg.matt.${PRODUCT_NAME:rfc1034identifier}";
462478
PRODUCT_NAME = CoffeeTime;
463479
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -478,8 +494,11 @@
478494
GCC_PRECOMPILE_PREFIX_HEADER = YES;
479495
GCC_PREFIX_HEADER = "ch26p899localNotification/CoffeeTime-Prefix.pch";
480496
INFOPLIST_FILE = "ch26p899localNotification/CoffeeTime-Info.plist";
481-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
482-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
497+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
498+
LD_RUNPATH_SEARCH_PATHS = (
499+
"$(inherited)",
500+
"@executable_path/Frameworks",
501+
);
483502
ONLY_ACTIVE_ARCH = NO;
484503
PRODUCT_BUNDLE_IDENTIFIER = "com.neuburg.matt.${PRODUCT_NAME:rfc1034identifier}";
485504
PRODUCT_NAME = CoffeeTime;

bk2ch13p630localNotification/CoffeeTimeNotificationUI/Info.plist

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>1</string>
22+
<string>$(CURRENT_PROJECT_VERSION)</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionAttributes</key>
2626
<dict>
27-
<key>UNNotificationExtensionUserInteractionEnabled</key>
28-
<true/>
2927
<key>UNNotificationExtensionCategory</key>
3028
<string>coffee</string>
31-
<key>UNNotificationExtensionInitialContentSizeRatio</key>
32-
<real>0.25</real>
3329
<key>UNNotificationExtensionDefaultContentHidden</key>
3430
<true/>
31+
<key>UNNotificationExtensionInitialContentSizeRatio</key>
32+
<real>0.25</real>
3533
<key>UNNotificationExtensionOverridesDefaultTitle</key>
3634
<false/>
35+
<key>UNNotificationExtensionUserInteractionEnabled</key>
36+
<true/>
3737
</dict>
3838
<key>NSExtensionMainStoryboard</key>
3939
<string>MainInterface</string>
Loading

0 commit comments

Comments
 (0)