質問編集履歴

2

他のクラスの可能性

2020/10/18 12:46

投稿

uskitm
uskitm

スコア0

test CHANGED
File without changes
test CHANGED
@@ -295,3 +295,81 @@
295
295
 
296
296
 
297
297
  それぞれの型は見直しても違いを確認できていません。。
298
+
299
+
300
+
301
+ さらに追記です。
302
+
303
+ エラーに関係すると思われる箇所です。
304
+
305
+
306
+
307
+ ```
308
+
309
+ import UIKit
310
+
311
+
312
+
313
+ class ProfileInfoHeaderCollectionReusableView: UICollectionReusableView {
314
+
315
+ static let identifier = "ProfileInfoHeaderCollectionReusableView"
316
+
317
+
318
+
319
+ override init(frame: CGRect) {
320
+
321
+ super.init(frame: frame)
322
+
323
+ backgroundColor = .systemBlue
324
+
325
+ clipsToBounds = true
326
+
327
+ }
328
+
329
+
330
+
331
+ required init?(coder: NSCoder) {
332
+
333
+ fatalError("init(coder:) has not been implemented")
334
+
335
+ }
336
+
337
+ }
338
+
339
+
340
+
341
+ ```
342
+
343
+
344
+
345
+ ```
346
+
347
+ import UIKit
348
+
349
+
350
+
351
+ class ProfileTabsCollectionReusableView: UICollectionReusableView {
352
+
353
+ static let identifier = "ProfileInfoHeaderCollectionReusableView"
354
+
355
+
356
+
357
+ override init(frame: CGRect) {
358
+
359
+ super.init(frame: frame)
360
+
361
+ backgroundColor = .orange
362
+
363
+ }
364
+
365
+
366
+
367
+ required init?(coder: NSCoder) {
368
+
369
+ fatalError("init(coder:) has not been implemented")
370
+
371
+ }
372
+
373
+ }
374
+
375
+ ```

1

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

2020/10/18 12:46

投稿

uskitm
uskitm

スコア0

test CHANGED
File without changes
test CHANGED
@@ -265,3 +265,33 @@
265
265
 
266
266
 
267
267
  xcode12.0.1です。
268
+
269
+
270
+
271
+
272
+
273
+ 追記です。
274
+
275
+ ```
276
+
277
+ Thread 1: signal SIGABRT
278
+
279
+ ```
280
+
281
+ のメッセージは
282
+
283
+ ```
284
+
285
+ let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind,
286
+
287
+ withReuseIdentifier: ProfileInfoHeaderCollectionReusableView.identifier,
288
+
289
+ for: indexPath) as! ProfileInfoHeaderCollectionReusableView
290
+
291
+ ```
292
+
293
+ の as 部分に出ています。
294
+
295
+
296
+
297
+ それぞれの型は見直しても違いを確認できていません。。