Created
July 23, 2021 05:16
-
-
Save yccheok/35c31a29e7f9eebdccfdc7cdfe9fe724 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
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