Sections
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
return1
}
/**
-?returns:?Section中Item的個(gè)數(shù)
*/
func?collectionView(collectionView:?UICollectionView,?numberOfItemsInSectionsection:?Int)?->?Int?{
return8
}
/**
-?returns:?繪制collectionView的cell
*/
func?collectionView(collectionView:?UICollectionView,?cellForItemAtIndexPathindexPath:?NSIndexPath)?->?UICollectionViewCell?{
let?cell?=?collectionView.dequeueReusableCellWithReuseIdentifier("MyCell",forIndexPath:?indexPath)?as!?CollectionViewCell
cell.imageView.image=?UIImage(named:"\(indexPath.row?+?2).png")
cell.label.text="美景\(indexPath.row?+?1)"
returncell
}