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
}
}
Post
Replies
Boosts
Views
Activity
<viewController id="BYZ-38-t0r" customClass="HomeViewController" customModule="Ves_"
This is what my view controller in storyboard.
Uiviewcontroller is not existed in xml file