Skip to content

Instantly share code, notes, and snippets.

@lugearma
Last active September 14, 2016 16:21
Show Gist options
  • Save lugearma/e27d4e6686e1b056c3b66924bc9ff621 to your computer and use it in GitHub Desktop.
Save lugearma/e27d4e6686e1b056c3b66924bc9ff621 to your computer and use it in GitHub Desktop.
import UIKit
let feedCellId = "feedCellId"
class FeedViewController: UICollectionViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.collectionView!.backgroundColor = UIColor.whiteColor()
self.collectionView?.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: feedCellId)
}
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 3
}
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(feedCellId, forIndexPath: indexPath)
return cell
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment