質問編集履歴
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -41,6 +41,8 @@
|
|
41
41
|
// MARK: - Lifecycle
|
42
42
|
|
43
43
|
override init(frame: CGRect) {
|
44
|
+
|
45
|
+
super.init(frame:frame)
|
44
46
|
|
45
47
|
addSubview(followersLabel)
|
46
48
|
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,21 @@
|
|
6
6
|
|
7
7
|
```ここに言語を入力
|
8
8
|
|
9
|
+
①
|
10
|
+
|
11
|
+
import UIKit
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
class ProfileHeader: UICollectionReusableView {
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
②
|
20
|
+
|
21
|
+
// MARK: - Properties
|
22
|
+
|
9
|
-
private var followersLabel: UILabel = {
|
23
|
+
private lazy var followersLabel: UILabel = {
|
10
24
|
|
11
25
|
let label = UILabel()
|
12
26
|
|
@@ -19,6 +33,68 @@
|
|
19
33
|
return label
|
20
34
|
|
21
35
|
}()
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
③
|
40
|
+
|
41
|
+
// MARK: - Lifecycle
|
42
|
+
|
43
|
+
override init(frame: CGRect) {
|
44
|
+
|
45
|
+
addSubview(followersLabel)
|
46
|
+
|
47
|
+
followersLabel.anchor(top:view.bottomAnchor,left: leftAnchor,
|
48
|
+
|
49
|
+
right: rightAnchor,paddingTop: 16,
|
50
|
+
|
51
|
+
paddingLeft: 24,paddingRight: 24)
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
④
|
58
|
+
|
59
|
+
// MARK: - Helpers
|
60
|
+
|
61
|
+
required init?(coder: NSCoder) {
|
62
|
+
|
63
|
+
fatalError("init(coder:) has not been implemented")
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
⑤
|
70
|
+
|
71
|
+
// MARK: - Actions
|
72
|
+
|
73
|
+
@objc func handleChangeProfileImage() {
|
74
|
+
|
75
|
+
print("ボタンがタップされました")
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
⑥
|
82
|
+
|
83
|
+
// MARK: - Helpers
|
84
|
+
|
85
|
+
func attributedStatText(value: Int,label: String) -> NSAttributedString {
|
86
|
+
|
87
|
+
let attributedText = NSMutableAttributedString(string: "(value)\n", attributes: [.font: UIFont.boldSystemFont(ofSize: 14)])
|
88
|
+
|
89
|
+
attributedText.append(NSAttributedString(string: label, attributes: [.font: UIFont.systemFont(ofSize: 14), .foregroundColor: UIColor.lightGray ]))
|
90
|
+
|
91
|
+
return attributedText
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
|
22
98
|
|
23
99
|
```
|
24
100
|
|