File tree Expand file tree Collapse file tree
EasyReader/Application/Controllers/Home Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)sender {
160160- (void )scrollViewDidEndDecelerating : (UIScrollView *)sender {
161161 // If we are scrolling in the collectionView only
162162 if ([sender isMemberOfClass: [CSFeedItemCollectionView class ]]) {
163-
164163 // unload the webView if we have moved to a new feedItem
165164 if (currentFeedItem != self.collectionView_feedItems .currentFeedItem ){
165+ currentFeedItem = self.collectionView_feedItems .currentFeedItem ;
166166 [self .feedItemWebView loadHTMLString: @" <html><head></head><body></body></html>" baseURL: nil ];
167167 }
168168 }
Original file line number Diff line number Diff line change @@ -38,6 +38,18 @@ - (id)initWithFeedItems:(NSArray *)feedItems
3838 return self;
3939}
4040
41+ - (void )sortFeedItems
42+ {
43+ NSMutableArray *sortableArray = [NSMutableArray arrayWithArray: [self .feedItems allObjects ]];
44+
45+ NSSortDescriptor *sortDescriptor;
46+ sortDescriptor = [[NSSortDescriptor alloc ] initWithKey: @" updatedAt"
47+ ascending: NO ];
48+ NSArray *sortDescriptors = [NSArray arrayWithObject: sortDescriptor];
49+ NSArray *sortedArray;
50+ sortedArray = [sortableArray sortedArrayUsingDescriptors: sortDescriptors];
51+ }
52+
4153/* *
4254 * Determines the number of sections in the collection view (in this case it's always 1)
4355 *
You can’t perform that action at this time.
0 commit comments