Post

Replies

Boosts

Views

Activity

Reply to Collection View IBoutlet crashes
i tried but is still didn't work this is my custom class class HomeViewController: UIViewController {   @IBOutlet weak var typeCollectionView: UICollectionView!   var type = ["Shirts","Pants","Tshirts"]       override func viewDidLoad() {     super.viewDidLoad()     // Do any additional setup after loading the view.   } } extension HomeViewController : UICollectionViewDataSource , UICollectionViewDelegate{   func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {     return type.count   }       func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {     let cell = typeCollectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! TypeCollectionViewCell     cell.typeLabel.text = type[indexPath.row]     return cell   }         }
Aug ’20