Deprecation of enum CoreStore, reorganize global symbols

This commit is contained in:
John Estropia
2019-08-29 17:03:09 +09:00
parent 02d5bf85ae
commit 266b1a9913
95 changed files with 2232 additions and 1837 deletions

View File

@@ -31,39 +31,20 @@ import CoreData
/**
`CoreStore` is the main entry point for all other APIs.
*/
@available(*, deprecated, message: "Call methods directly from the DataStack instead")
public enum CoreStore {
/**
The default `DataStack` instance to be used. If `defaultStack` is not set before the first time accessed, a default-configured `DataStack` will be created.
- SeeAlso: `DataStack`
- Note: Changing the `defaultStack` is thread safe, but it is recommended to setup `DataStacks` on a common queue (e.g. the main queue).
*/
@available(*, unavailable, renamed: "Shared.logger")
public static var logger: CoreStoreLogger {
get { return Shared.logger }
set { Shared.logger = newValue }
}
@available(*, unavailable, renamed: "Shared.defaultStack")
public static var defaultStack: DataStack {
get {
self.defaultStackBarrierQueue.sync(flags: .barrier) {
if self.defaultStackInstance == nil {
self.defaultStackInstance = DataStack()
}
}
return self.defaultStackInstance!
}
set {
self.defaultStackBarrierQueue.async(flags: .barrier) {
self.defaultStackInstance = newValue
}
}
get { return Shared.defaultStack }
set { Shared.defaultStack = newValue }
}
// MARK: Private
private static let defaultStackBarrierQueue = DispatchQueue.concurrent("com.coreStore.defaultStackBarrierQueue")
private static var defaultStackInstance: DataStack?
}