Skip to content

Instantly share code, notes, and snippets.

@vikdenic
Created March 2, 2015 20:55
Show Gist options
  • Select an option

  • Save vikdenic/fc4c30e10d57ac14167a to your computer and use it in GitHub Desktop.

Select an option

Save vikdenic/fc4c30e10d57ac14167a to your computer and use it in GitHub Desktop.
animate collectionView addition
var indexPathArray = [NSIndexPath]()
var index = 0
for message in messages {
self.messages.insert(message, atIndex: index)
indexPathArray.insert(NSIndexPath(forItem: index, inSection: 0), atIndex: index)
index++
}
self.collectionView.insertItemsAtIndexPaths(indexPathArray)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment