I have two collectionviews inside tableviewcell. I have set the first one and it works greats. The problem is i dont know how to call second collectionview in datasource protocol functions.
PS i have used ashfurrow`s tutorial for the first one.
In collection view datasource methods, you need to check the collection view reference for which the method is called ,ie,
Example
func collectionView(_ collectionView: UICollectionView,
numberOfItemsInSection section: Int) -> Int
{
if collectionView === self.collectionView1
{
//code for 1st collection view
}
else if collectionView === self.collectionView2
{
//code for 2nd collection view
}
}
Apply same check in other collection view datasource methods.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.