Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
else if type == NSFetchedResultsChangeType.move {
// A hackish way to ensure PIN icon is updated.
if let newIndexPath = newIndexPath, let indexPath = indexPath {
if let plainNote = nsPlainNoteProvider.getNSPlainNote(newIndexPath), let noteCell = collectionView.cellForItem(at: indexPath) as? NoteCell {
noteCell.update(
plainNote,
selected: false,
animate: false
)
}
}
blockOperations.append(
BlockOperation(block: { [weak self] in
if let self = self, let newIndexPath = newIndexPath, let indexPath = indexPath {
self.collectionView.moveItem(at: indexPath, to: newIndexPath)
}
})
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment