Created
February 8, 2017 07:32
-
-
Save madhu314/4ee6c8527c9c81678bb687a93b3230b6 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
func remove(item: ListItem, on collectionView: UICollectionView) { | |
let foundIndex = items.index { (given) -> Bool in | |
return given.id == item.id | |
} | |
if let index = foundIndex { | |
items.remove(at: index) | |
collectionView.deleteItems(at: [IndexPath(item: index, section: 0)]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment