I have ViewController
where have two collectionView
but for one I want isPagingEnabled
for cell and for anther collectionView
3 item for full frame width. How can I do that ?
MenuCollectionView for paging : it working perfectly
func setupMenuCollection(){
if let flowLayout = menuCollectionView?.collectionViewLayout as? UICollectionViewFlowLayout {
flowLayout.scrollDirection = .horizontal
flowLayout.minimumLineSpacing = 0
}
menuCollectionView?.backgroundColor = UIColor.white
menuCollectionView?.contentInset = UIEdgeInsetsMake(50, 0, 0, 0)
menuCollectionView?.scrollIndicatorInsets = UIEdgeInsetsMake(50, 0, 0, 0)
menuCollectionView?.isPagingEnabled = true
}
It is for manubarCollectionView : it is not working because here no else statement.
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
if manubarCollectionView == collectionView {
return CGSize(width: view.frame.width / 3, height: manubarCollectionView.frame.height)
}
}