teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

他のクラスの可能性

2020/10/18 12:46

投稿

uskitm
uskitm

スコア0

title CHANGED
File without changes
body CHANGED
@@ -146,4 +146,43 @@
146
146
  ```
147
147
  の as 部分に出ています。
148
148
 
149
- それぞれの型は見直しても違いを確認できていません。。
149
+ それぞれの型は見直しても違いを確認できていません。。
150
+
151
+ さらに追記です。
152
+ エラーに関係すると思われる箇所です。
153
+
154
+ ```
155
+ import UIKit
156
+
157
+ class ProfileInfoHeaderCollectionReusableView: UICollectionReusableView {
158
+ static let identifier = "ProfileInfoHeaderCollectionReusableView"
159
+
160
+ override init(frame: CGRect) {
161
+ super.init(frame: frame)
162
+ backgroundColor = .systemBlue
163
+ clipsToBounds = true
164
+ }
165
+
166
+ required init?(coder: NSCoder) {
167
+ fatalError("init(coder:) has not been implemented")
168
+ }
169
+ }
170
+
171
+ ```
172
+
173
+ ```
174
+ import UIKit
175
+
176
+ class ProfileTabsCollectionReusableView: UICollectionReusableView {
177
+ static let identifier = "ProfileInfoHeaderCollectionReusableView"
178
+
179
+ override init(frame: CGRect) {
180
+ super.init(frame: frame)
181
+ backgroundColor = .orange
182
+ }
183
+
184
+ required init?(coder: NSCoder) {
185
+ fatalError("init(coder:) has not been implemented")
186
+ }
187
+ }
188
+ ```

1

コメントいただいた件についてです。

2020/10/18 12:46

投稿

uskitm
uskitm

スコア0

title CHANGED
File without changes
body CHANGED
@@ -131,4 +131,19 @@
131
131
  それらしい箇所を見つけることもできず、、
132
132
  助言いただければ幸いです。
133
133
 
134
- xcode12.0.1です。
134
+ xcode12.0.1です。
135
+
136
+
137
+ 追記です。
138
+ ```
139
+ Thread 1: signal SIGABRT
140
+ ```
141
+ のメッセージは
142
+ ```
143
+ let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind,
144
+ withReuseIdentifier: ProfileInfoHeaderCollectionReusableView.identifier,
145
+ for: indexPath) as! ProfileInfoHeaderCollectionReusableView
146
+ ```
147
+ の as 部分に出ています。
148
+
149
+ それぞれの型は見直しても違いを確認できていません。。