mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-25 02:41:24 +01:00
silence deprecation internal warnings
This commit is contained in:
@@ -324,38 +324,6 @@ extension GroupBy: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if os(iOS) || os(macOS)
|
|
||||||
|
|
||||||
// MARK: - ICloudStore
|
|
||||||
|
|
||||||
@available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
|
|
||||||
extension ICloudStore: CustomDebugStringConvertible, CoreStoreDebugStringConvertible {
|
|
||||||
|
|
||||||
// MARK: CustomDebugStringConvertible
|
|
||||||
|
|
||||||
public var debugDescription: String {
|
|
||||||
|
|
||||||
return formattedDebugDescription(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// MARK: CoreStoreDebugStringConvertible
|
|
||||||
|
|
||||||
public var coreStoreDumpString: String {
|
|
||||||
|
|
||||||
return createFormattedString(
|
|
||||||
"(", ")",
|
|
||||||
("configuration", self.configuration as Any),
|
|
||||||
("storeOptions", self.storeOptions as Any),
|
|
||||||
("cacheFileURL", self.cacheFileURL),
|
|
||||||
("cloudStorageOptions", self.cloudStorageOptions)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// MARK: - InMemoryStore
|
// MARK: - InMemoryStore
|
||||||
|
|
||||||
extension InMemoryStore: CustomDebugStringConvertible, CoreStoreDebugStringConvertible {
|
extension InMemoryStore: CustomDebugStringConvertible, CoreStoreDebugStringConvertible {
|
||||||
|
|||||||
@@ -86,8 +86,12 @@ public extension KeyPathString {
|
|||||||
|
|
||||||
// MARK: - KeyPath: DynamicKeyPath
|
// MARK: - KeyPath: DynamicKeyPath
|
||||||
|
|
||||||
// TODO: SE-0143 is not implemented: https://github.com/apple/swift-evolution/blob/master/proposals/0143-conditional-conformances.md
|
// TODO: SE-0143 (https://github.com/apple/swift-evolution/blob/master/proposals/0143-conditional-conformances.md) is implemented but multiple conformances for the same type currently cannot be declared.
|
||||||
//extension KeyPath: DynamicKeyPath where Root: NSManagedObject, Value: ImportableAttributeType {
|
//extension KeyPath: DynamicKeyPath where Root: NSManagedObject, Value: ImportableAttributeType
|
||||||
|
//extension KeyPath: DynamicKeyPath where Root: NSManagedObject, Value: ImportableAttributeType?
|
||||||
|
//extension KeyPath: DynamicKeyPath where Root: NSManagedObject, Value: NSManagedObject?
|
||||||
|
//extension KeyPath: DynamicKeyPath where Root: NSManagedObject, Value: NSSet
|
||||||
|
//extension KeyPath: DynamicKeyPath where Root: NSManagedObject, Value: NSOrderedSet
|
||||||
extension KeyPath: DynamicKeyPath {
|
extension KeyPath: DynamicKeyPath {
|
||||||
|
|
||||||
public typealias ObjectType = Root
|
public typealias ObjectType = Root
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import CoreData
|
|||||||
A storage interface backed by an SQLite database managed by iCloud.
|
A storage interface backed by an SQLite database managed by iCloud.
|
||||||
*/
|
*/
|
||||||
@available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
|
@available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
|
||||||
public final class ICloudStore: CloudStorage {
|
public final class ICloudStore: CloudStorage, CustomDebugStringConvertible, CoreStoreDebugStringConvertible {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes an iCloud store interface from the given ubiquitous store information. Returns `nil` if the container could not be located or if iCloud storage is unavailable for the current user or device
|
Initializes an iCloud store interface from the given ubiquitous store information. Returns `nil` if the container could not be located or if iCloud storage is unavailable for the current user or device
|
||||||
@@ -449,6 +449,65 @@ public final class ICloudStore: CloudStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MARK: CustomDebugStringConvertible
|
||||||
|
|
||||||
|
public var debugDescription: String {
|
||||||
|
|
||||||
|
func formattedValue(_ any: Any) -> String {
|
||||||
|
|
||||||
|
switch any {
|
||||||
|
|
||||||
|
case let any as CoreStoreDebugStringConvertible:
|
||||||
|
return any.coreStoreDumpString
|
||||||
|
|
||||||
|
default:
|
||||||
|
return "\(any)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var string = "(\(String(reflecting: type(of: self)))) "
|
||||||
|
string.append(formattedValue(self))
|
||||||
|
return string
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MARK: CoreStoreDebugStringConvertible
|
||||||
|
|
||||||
|
public var coreStoreDumpString: String {
|
||||||
|
|
||||||
|
func formattedValue(_ any: Any) -> String {
|
||||||
|
|
||||||
|
switch any {
|
||||||
|
|
||||||
|
case let any as CoreStoreDebugStringConvertible:
|
||||||
|
return any.coreStoreDumpString
|
||||||
|
|
||||||
|
default:
|
||||||
|
return "\(any)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func createFormattedString(_ firstLine: String, _ lastLine: String, _ info: [(key: String, value: Any)]) -> String {
|
||||||
|
|
||||||
|
var string = firstLine
|
||||||
|
for (key, value) in info {
|
||||||
|
|
||||||
|
string.append("\n.\(key) = \(formattedValue(value));")
|
||||||
|
}
|
||||||
|
string = string.replacingOccurrences(of: "\n", with: "\n\(String(repeating: " ", count: 4))")
|
||||||
|
string.append("\n\(lastLine)")
|
||||||
|
return string
|
||||||
|
}
|
||||||
|
return createFormattedString(
|
||||||
|
"(", ")",
|
||||||
|
[
|
||||||
|
("configuration", self.configuration as Any),
|
||||||
|
("storeOptions", self.storeOptions as Any),
|
||||||
|
("cacheFileURL", self.cacheFileURL),
|
||||||
|
("cloudStorageOptions", self.cloudStorageOptions)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// MARK: Private
|
// MARK: Private
|
||||||
|
|
||||||
fileprivate struct Static {
|
fileprivate struct Static {
|
||||||
|
|||||||
@@ -105,24 +105,4 @@ public protocol ICloudStoreObserver: class {
|
|||||||
func iCloudStoreDidRemoveContent(storage: ICloudStore, dataStack: DataStack)
|
func iCloudStoreDidRemoveContent(storage: ICloudStore, dataStack: DataStack)
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(*, deprecated, message: "Please see the release notes and Core Data documentation.")
|
|
||||||
public extension ICloudStoreObserver {
|
|
||||||
|
|
||||||
public func iCloudStoreWillFinishUbiquitousStoreInitialImport(storage: ICloudStore, dataStack: DataStack) {}
|
|
||||||
|
|
||||||
public func iCloudStoreDidFinishUbiquitousStoreInitialImport(storage: ICloudStore, dataStack: DataStack) {}
|
|
||||||
|
|
||||||
public func iCloudStoreWillAddAccount(storage: ICloudStore, dataStack: DataStack) {}
|
|
||||||
|
|
||||||
public func iCloudStoreDidAddAccount(storage: ICloudStore, dataStack: DataStack) {}
|
|
||||||
|
|
||||||
public func iCloudStoreWillRemoveAccount(storage: ICloudStore, dataStack: DataStack) {}
|
|
||||||
|
|
||||||
public func iCloudStoreDidRemoveAccount(storage: ICloudStore, dataStack: DataStack) {}
|
|
||||||
|
|
||||||
public func iCloudStoreWillRemoveContent(storage: ICloudStore, dataStack: DataStack) {}
|
|
||||||
|
|
||||||
public func iCloudStoreDidRemoveContent(storage: ICloudStore, dataStack: DataStack) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ internal extension NSManagedObjectContext {
|
|||||||
#if os(iOS) || os(macOS)
|
#if os(iOS) || os(macOS)
|
||||||
|
|
||||||
context.observerForDidImportUbiquitousContentChangesNotification = NotificationObserver(
|
context.observerForDidImportUbiquitousContentChangesNotification = NotificationObserver(
|
||||||
notificationName: NSNotification.Name.NSPersistentStoreDidImportUbiquitousContentChanges,
|
notificationName: NSNotification.Name("com.apple.coredata.ubiquity.importer.didfinishimport"), // NSNotification.Name.NSPersistentStoreDidImportUbiquitousContentChanges (used string literals to silence deprecation warning)
|
||||||
object: coordinator,
|
object: coordinator,
|
||||||
closure: { [weak context] (note) -> Void in
|
closure: { [weak context] (note) -> Void in
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user