Ramotion / cardslider

:octocat: 🃏 Cardslider is a design UI controller that allows you to swipe through cards with pictures and accompanying descriptions.
https://www.ramotion.com/iphone-app-development-ui-library-for-swiping-through-objects/
MIT License
1.27k stars 101 forks source link

How to delete a item #13

Open JRJian opened 5 years ago

JRJian commented 5 years ago

I tried to delete a cell from collection view on didSelect method. But I had get a crash:[self.collectionView performBatchUpdates:^{ [self.movies removeObjectAtIndex:0]; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; [self.collectionView deleteItemsAtIndexPaths:@[indexPath]]; } completion:^(BOOL finished) { NSLog(@"finished"); }]; Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'