You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use more than one UICollectionViewCell in the table view
Description:
I want to use more than one UICollectionViewCell in the table view but get fatal error like the custom cell didn't registered!
It works just with one view cell (default cell or custom cell) but if i want to use mixed of these i got error.
Thanks for your help 👍
Expected Behavior:
Show default cell with custom new cell
Actual Behavior:
Fatal error
Steps to Reproduce:
Custom cell -> GameCell.swift
import UIKit
class GameCell: UICollectionViewCell {
static let id: String = "collectionViewCellID"
override init(frame: CGRect) {
super.init(frame: frame)
setupViews()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
let imageView: UIImageView = {
let iv = UIImageView()
iv.contentMode = .scaleAspectFill
iv.layer.cornerRadius = 16
iv.layer.masksToBounds = true
iv.image = UIImage(named: "someImage")
return iv
}()
func setupViews() {
addSubview(imageView)
imageView.frame = CGRect(x: 0, y: 0, width: frame.width, height: frame.width)
}
}
I want to use more than one UICollectionViewCell in the table view
Description:
I want to use more than one UICollectionViewCell in the table view but get fatal error like the custom cell didn't registered!
It works just with one view cell (default cell or custom cell) but if i want to use mixed of these i got error.
Thanks for your help 👍
Expected Behavior:
Show default cell with custom new cell
Actual Behavior:
Fatal error
Steps to Reproduce:
Custom cell -> GameCell.swift
GLCollectionTableViewCell.swift -> line 147
collectionView.register(GameCell.self, forCellWithReuseIdentifier: GameCell.id)
GLTableCollectionViewController.swift -> line 117
Your Environment:
The text was updated successfully, but these errors were encountered: