mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-26 19:31:29 +01:00
fix iOS 10 NSFetchedResultsController bug for iOS 7-supporting branch
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = "CoreStore"
|
s.name = "CoreStore"
|
||||||
s.version = "2.0.6"
|
s.version = "2.0.7"
|
||||||
s.license = "MIT"
|
s.license = "MIT"
|
||||||
s.summary = "Unleashing the real power of Core Data with the elegance and safety of Swift"
|
s.summary = "Unleashing the real power of Core Data with the elegance and safety of Swift"
|
||||||
s.homepage = "https://github.com/JohnEstropia/CoreStore"
|
s.homepage = "https://github.com/JohnEstropia/CoreStore"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.0.6</string>
|
<string>2.0.7</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ internal final class FetchedResultsControllerDelegate: NSObject, NSFetchedResult
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
guard let actualType = NSFetchedResultsChangeType(rawValue: type.rawValue) else {
|
guard var actualType = NSFetchedResultsChangeType(rawValue: type.rawValue) else {
|
||||||
|
|
||||||
// This fix is for a bug where iOS passes 0 for NSFetchedResultsChangeType, but this is not a valid enum case.
|
// This fix is for a bug where iOS passes 0 for NSFetchedResultsChangeType, but this is not a valid enum case.
|
||||||
// Swift will then always execute the first case of the switch causing strange behaviour.
|
// Swift will then always execute the first case of the switch causing strange behaviour.
|
||||||
@@ -121,6 +121,16 @@ internal final class FetchedResultsControllerDelegate: NSObject, NSFetchedResult
|
|||||||
// https://forums.developer.apple.com/message/9998#9998
|
// https://forums.developer.apple.com/message/9998#9998
|
||||||
// https://forums.developer.apple.com/message/31849#31849
|
// https://forums.developer.apple.com/message/31849#31849
|
||||||
|
|
||||||
|
if #available(iOS 10.0, tvOS 10.0, watchOS 3.0, *) {
|
||||||
|
|
||||||
|
// I don't know if iOS 10 even attempted to fix this mess...
|
||||||
|
if case .Update = actualType
|
||||||
|
where indexPath != nil && newIndexPath != nil {
|
||||||
|
|
||||||
|
actualType = .Move
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch actualType {
|
switch actualType {
|
||||||
|
|
||||||
case .Update:
|
case .Update:
|
||||||
|
|||||||
Reference in New Issue
Block a user