Skip to content

Commit 81cdbd6

Browse files
committed
Chapter 14 updates
1 parent e7b4d8e commit 81cdbd6

26 files changed

+432
-112
lines changed

Chapter 14/MyProjectClient/Application/Assets/Base.lproj/Main.storyboard

Lines changed: 0 additions & 24 deletions
This file was deleted.

Chapter 14/MyProjectClient/Application/Sources/SceneDelegate.swift

Lines changed: 0 additions & 53 deletions
This file was deleted.

Chapter 14/MyProjectClient/Application/Sources/ViewController.swift

Lines changed: 0 additions & 22 deletions
This file was deleted.

Chapter 14/MyProjectClient/Application/Assets/Info.plist renamed to Chapter 14/MyProjectClient/iOS/Assets/Info.plist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,12 @@
3333
<string>Default Configuration</string>
3434
<key>UISceneDelegateClassName</key>
3535
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
36-
<key>UISceneStoryboardFile</key>
37-
<string>Main</string>
3836
</dict>
3937
</array>
4038
</dict>
4139
</dict>
4240
<key>UILaunchStoryboardName</key>
4341
<string>LaunchScreen</string>
44-
<key>UIMainStoryboardFile</key>
45-
<string>Main</string>
4642
<key>UIRequiredDeviceCapabilities</key>
4743
<array>
4844
<string>armv7</string>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//
2+
// CustomCell.swift
3+
// MyProject
4+
//
5+
// Created by Tibor Bodecs on 2020. 05. 15..
6+
// Copyright © 2020. Tibor Bodecs. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class CustomCell: UITableViewCell {
12+
weak var coverView: UIImageView!
13+
weak var titleLabel: UILabel!
14+
15+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
16+
super.init(style: style, reuseIdentifier: reuseIdentifier)
17+
18+
self.initialize()
19+
}
20+
21+
required init?(coder aDecoder: NSCoder) {
22+
super.init(coder: aDecoder)
23+
24+
self.initialize()
25+
}
26+
27+
func initialize() {
28+
let coverView = UIImageView(frame: .zero)
29+
coverView.translatesAutoresizingMaskIntoConstraints = false
30+
self.contentView.addSubview(coverView)
31+
self.coverView = coverView
32+
33+
let titleLabel = UILabel(frame: .zero)
34+
titleLabel.translatesAutoresizingMaskIntoConstraints = false
35+
self.contentView.addSubview(titleLabel)
36+
self.titleLabel = titleLabel
37+
38+
NSLayoutConstraint.activate([
39+
self.contentView.topAnchor.constraint(equalTo: self.coverView.topAnchor),
40+
self.contentView.bottomAnchor.constraint(equalTo: self.coverView.bottomAnchor),
41+
self.contentView.leadingAnchor.constraint(equalTo: self.coverView.leadingAnchor),
42+
self.contentView.trailingAnchor.constraint(equalTo: self.coverView.trailingAnchor),
43+
44+
self.contentView.centerXAnchor.constraint(equalTo: self.titleLabel.centerXAnchor),
45+
self.contentView.centerYAnchor.constraint(equalTo: self.titleLabel.centerYAnchor),
46+
])
47+
48+
self.titleLabel.font = UIFont.systemFont(ofSize: 64)
49+
}
50+
51+
override func prepareForReuse() {
52+
super.prepareForReuse()
53+
54+
self.coverView.image = nil
55+
}
56+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// MyCell.swift
3+
// MyProject
4+
//
5+
// Created by Tibor Bodecs on 2020. 05. 15..
6+
// Copyright © 2020. Tibor Bodecs. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class MyCell: UITableViewCell {
12+
13+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
14+
super.init(style: style, reuseIdentifier: reuseIdentifier)
15+
16+
self.initialize()
17+
}
18+
19+
required init?(coder aDecoder: NSCoder) {
20+
super.init(coder: aDecoder)
21+
22+
self.initialize()
23+
}
24+
25+
func initialize() {
26+
27+
}
28+
29+
override func prepareForReuse() {
30+
super.prepareForReuse()
31+
32+
}
33+
}

Chapter 14/MyProjectClient/Application/Sources/AppDelegate.swift renamed to Chapter 14/MyProjectClient/iOS/Sources/AppDelegate.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,19 @@ import UIKit
1111
@UIApplicationMain
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
1313

14-
15-
1614
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17-
// Override point for customization after application launch.
15+
1816
return true
1917
}
2018

2119
// MARK: UISceneSession Lifecycle
2220

2321
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
24-
// Called when a new scene session is being created.
25-
// Use this method to select a configuration to create the new scene with.
2622
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
2723
}
2824

2925
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
30-
// Called when the user discards a scene session.
31-
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
32-
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
26+
3327
}
3428

3529

0 commit comments

Comments
 (0)