Created
September 2, 2016 14:49
-
-
Save andatta/fc0d78732e50ccb38e84d488eda30fd9 to your computer and use it in GitHub Desktop.
This file contains 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
/*code snippet shows how we can delete items from collection view without reloading it | |
the below function is attcahed as selector to a button embedded in collection view cell*/ | |
func removeItem(sender : UIButton){ | |
if let collectionViewCell = sender.superview?.superview as? UICollectionViewCell{ | |
if let indexPath = self.docsCollectionView.indexPathForCell(collectionViewCell){ | |
self.items.removeAtIndex(indexPath.row) | |
self.collectionView.deleteItemsAtIndexPaths([indexPath]) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment