First create a new view xib, then delete the auto-generated view, drag into a Uicollectioncell, and then create a corresponding UIView inheritance Uicollectioncell class.
OK, next to the outlet even.
Set delegate and DataSource
And then usually we're going to do this,
Func CollectionView (Collectionview:uicollectionview, Cellforitematindexpath Indexpath:nsindexpath) uicollectionviewcell{let cell = Collectionview.dequeuereusablecellwithreuseidentifier (" Personalizedsettingsmoviecell ", Forindexpath:indexpath) as Personalizedsettingsmoviecell return cell }
But it's just not possible to find Personalizedsettingsmoviecell's Identifier, so we're going to
1. Set the cell's identifier inside the xib.
2.UICollectionCell to set
Collectionview.registernib (uinib (nibname: "Personalizedsettingsmoviecell", Bundle:nil), Forcellwithreuseidentifier: "Personalizedsettingsmoviecell")
[IOS] defines cell with Xib and then associates Uicollectionview