mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-11-28 11:22:37 +01:00
tidy up
This commit is contained in:
1 parent
ae77558ae8
commit
0b6298a802
1 file changed
+5
-4
@@ -82,10 +82,11 @@ internal final class FetchedResultsControllerDelegate: NSObject, NSFetchedResult
|
|||||||
|
|
||||||
@objc dynamic func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) {
|
@objc dynamic func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) {
|
||||||
|
|
||||||
// This fix is for a bug where Apple passes 0 for NSFetchedResultsChangeType, but this is not a valid enum case.
|
guard type.rawValue > 0 else {
|
||||||
// Swift will then always execute the first case of the switch causing strange behaviour.
|
|
||||||
// https://forums.developer.apple.com/thread/12184#31850
|
// This fix is for a bug where Apple passes 0 for NSFetchedResultsChangeType, but this is not a valid enum case.
|
||||||
if type.rawValue == 0 {
|
// Swift will then always execute the first case of the switch causing strange behaviour.
|
||||||
|
// https://forums.developer.apple.com/thread/12184#31850
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user