回答編集履歴
1
s
test
CHANGED
@@ -11,3 +11,33 @@
|
|
11
11
|
[The Swift Programming Language (Swift 4.1) - Properties](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Properties.html)
|
12
12
|
|
13
13
|
[Stored property と Computed property](https://qiita.com/tekun43/items/5e1d7972ed0b54daeb04)
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
そしておそらくMarkfourXさんのやりたいこととしてはこの場合保存型プロパティで、以下の様になります。
|
18
|
+
|
19
|
+
この場合の初期値は`空文字`になります。
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
```swift
|
24
|
+
|
25
|
+
class TitleTableViewCell: UITableViewCell {
|
26
|
+
|
27
|
+
@IBOutlet private weak var titleLabel: UILabel!
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
public var title: String = "" {
|
32
|
+
|
33
|
+
didSet {
|
34
|
+
|
35
|
+
titleLabel.text = title
|
36
|
+
|
37
|
+
}
|
38
|
+
|
39
|
+
}
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
```
|