Skip to content

Instantly share code, notes, and snippets.

@kevinvavelin
Created November 1, 2014 00:50
Show Gist options
  • Save kevinvavelin/a86ff0f8d5dfc6388da6 to your computer and use it in GitHub Desktop.
Save kevinvavelin/a86ff0f8d5dfc6388da6 to your computer and use it in GitHub Desktop.
override func viewDidLoad() {
super.viewDidLoad()
var collectionViewFlowLayout = UICollectionViewFlowLayout()
twitterCardCollectionView = UICollectionView(frame:CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height), collectionViewLayout: collectionViewFlowLayout)
twitterCardCollectionView.registerClass(MultipleCardCollectionViewCell.self, forCellWithReuseIdentifier: "account")
twitterCardCollectionView.delegate = self
twitterCardCollectionView.dataSource = self
twitterCardCollectionView.backgroundColor = UIColor.clearColor()
self.view.addSubview(twitterCardCollectionView)
}
// Crash appears exactly here
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("account", forIndexPath: indexPath) as MultipleCardCollectionViewCell
//A lot of configuration after
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment