I have three UICollectionView
inside one UIViewController
. Then I set IBOutlet for each UICollectionView
@IBOutlet weak var firstCollectionView: UICollectionView!
@IBOutlet weak var secondCollectionView: UICollectionView!
@IBOutlet weak var thirdCollectionView: UICollectionView!
and I set delegate and datasource for them. But when I want to set numberOfItemsInSection
like below
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
if collectionView == firstCollectionView {
return 1
} else if collectionView == secondCollectionView {
return 2
} else if collectionView == thirdCollectionView {
return 3
}
}
It keeps giving me this error Missing return in a function expected to return 'Int'