Skip to content

Commit 9c6ee13

Browse files
committed
mild chapter 8 and 9 tweaks
1 parent f422f63 commit 9c6ee13

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

bk2ch08p408selfConfiguringCell/SelfConfiguringCell/MyCell.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ class MyCell : UITableViewCell {
1111
let image: UIImage
1212
}
1313
func configure(_ configuration: Configuration) {
14-
let lab = self.theLabel
15-
lab?.text = configuration.text
16-
let iv = self.theImageView
14+
let lab = self.theLabel!
15+
lab.text = configuration.text
16+
let iv = self.theImageView!
1717
let im = configuration.image
1818
let r = UIGraphicsImageRenderer(size:CGSize(36,36), format:im.imageRendererFormat)
1919
let im2 = r.image {
2020
_ in im.draw(in:CGRect(0,0,36,36))
2121
}
22-
iv?.image = im2
23-
iv?.contentMode = .center
22+
iv.image = im2
23+
iv.contentMode = .center
2424
}
2525
}
2626

bk2ch08p408selfConfiguringCell/SelfConfiguringCell/RootViewController.swift

+3-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ class RootViewController : UITableViewController {
4343

4444
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
4545
let cell = tableView.dequeueReusableCell(withIdentifier: self.cellID, for: indexPath) as! MyCell
46-
let config = MyCell.Configuration(
47-
text: "The author of this book, who would rather be out dirt biking",
48-
image: UIImage(named:"moi.png")!
49-
)
46+
let s = "The author of this book, who would rather be out dirt biking"
47+
let im = UIImage(named:"moi.png")!
48+
let config = MyCell.Configuration(text: s, image: im)
5049
cell.configure(config)
5150
return cell
5251
}

bk2ch08p445deleteTableRows/ch21p740deleteTableRows.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@
464464
buildSettings = {
465465
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
466466
CLANG_ENABLE_MODULES = YES;
467+
DEVELOPMENT_TEAM = W3LHX5RGV2;
467468
GCC_PRECOMPILE_PREFIX_HEADER = YES;
468469
GCC_PREFIX_HEADER = "";
469470
INFOPLIST_FILE = "ch21p718sections/ch21p740deleteTableRows-Info.plist";
@@ -487,6 +488,7 @@
487488
buildSettings = {
488489
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
489490
CLANG_ENABLE_MODULES = YES;
491+
DEVELOPMENT_TEAM = W3LHX5RGV2;
490492
GCC_PRECOMPILE_PREFIX_HEADER = YES;
491493
GCC_PREFIX_HEADER = "";
492494
INFOPLIST_FILE = "ch21p718sections/ch21p740deleteTableRows-Info.plist";

bk2ch08p465CollectionViewLists2b/CollectionViewLists/CollectionViewController.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class CollectionViewController: UICollectionViewController {
5656
var contentConfig = v.defaultContentConfiguration()
5757
contentConfig.text = "Pep \(indexPath.section)"
5858
v.contentConfiguration = contentConfig
59-
v.layer.zPosition = 1
59+
// this was a bug workaround, but they fixed the bug
60+
// v.layer.zPosition = 1
6061
return v
6162
}
6263
}

bk2ch09p494MultipleWindows/ch19p626pageController/SceneDelegate.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
4545
if !pepName.isEmpty {
4646
scene.title = "Editing"
4747
let s = scene.session.configuration.storyboard!
48-
let peped = s.instantiateViewController(identifier: "pepEditor") as! PepEditorViewController
49-
peped.pepName = pepName
50-
self.window?.rootViewController = peped
51-
peped.restorationInfo = scene.userActivity?.userInfo
48+
let pepEditor = s.instantiateViewController(identifier: "pepEditor") as! PepEditorViewController
49+
pepEditor.pepName = pepName
50+
self.window?.rootViewController = pepEditor
51+
pepEditor.restorationInfo = scene.userActivity?.userInfo
5252
return
5353
}
5454

0 commit comments

Comments
 (0)