Created
March 2, 2015 21:00
-
-
Save vikdenic/830e3cd233005c41692a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if error == nil | |
| { | |
| let mostRecentMessage = self.messages.first | |
| var indexPathArray = [NSIndexPath]() | |
| var index = 0 | |
| for tweet in tweetMessages | |
| { | |
| //If any new tweets are found, add them to the array | |
| if tweet.bornOn!.compare(mostRecentMessage!.bornOn!) == NSComparisonResult.OrderedDescending | |
| { | |
| self.messages.insert(tweet, 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