mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-30 14:12:09 +02:00
tidy up
This commit is contained in:
@@ -108,7 +108,7 @@ internal extension NSManagedObjectModel {
|
||||
fatalError("Could not create an \(typeName(NSManagedObjectModel)) from the model at URL \"\(modelFileURL)\".")
|
||||
}
|
||||
|
||||
@nonobjc private(set) internal var currentModelVersion: String? {
|
||||
@nonobjc internal private(set) var currentModelVersion: String? {
|
||||
|
||||
get {
|
||||
|
||||
@@ -128,7 +128,7 @@ internal extension NSManagedObjectModel {
|
||||
}
|
||||
}
|
||||
|
||||
@nonobjc private(set) internal var modelVersions: Set<String>? {
|
||||
@nonobjc internal private(set) var modelVersions: Set<String>? {
|
||||
|
||||
get {
|
||||
|
||||
|
||||
64
CoreStore/Internal/NSPersistentStoreCoordinator+Setup.swift
Normal file
64
CoreStore/Internal/NSPersistentStoreCoordinator+Setup.swift
Normal file
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// NSPersistentStoreCoordinator+Setup.swift
|
||||
// CoreStore
|
||||
//
|
||||
// Copyright © 2016 John Rommel Estropia
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
// MARK: - NSPersistentStoreCoordinator
|
||||
|
||||
internal extension NSPersistentStoreCoordinator {
|
||||
|
||||
// MARK: Internal
|
||||
|
||||
internal func addPersistentStoreSynchronously(storeType: String, configuration: String?, URL storeURL: NSURL?, options: [NSObject : AnyObject]?) throws -> NSPersistentStore {
|
||||
|
||||
var store: NSPersistentStore?
|
||||
var storeError: NSError?
|
||||
self.performBlockAndWait {
|
||||
|
||||
do {
|
||||
|
||||
store = try self.addPersistentStoreWithType(
|
||||
storeType,
|
||||
configuration: configuration,
|
||||
URL: storeURL,
|
||||
options: options
|
||||
)
|
||||
}
|
||||
catch {
|
||||
|
||||
storeError = error as NSError
|
||||
}
|
||||
}
|
||||
|
||||
if let store = store {
|
||||
|
||||
return store
|
||||
}
|
||||
|
||||
throw storeError ?? NSError(coreStoreErrorCode: .UnknownError)
|
||||
}
|
||||
}
|
||||
@@ -37,8 +37,5 @@ internal final class WeakObject {
|
||||
self.object = object
|
||||
}
|
||||
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private(set) weak var object: AnyObject?
|
||||
internal private(set) weak var object: AnyObject?
|
||||
}
|
||||
|
||||
@@ -854,7 +854,7 @@ public final class ListMonitor<T: NSManagedObject> {
|
||||
/**
|
||||
Returns `true` if a call to `refetch(...)` was made to the `ListMonitor` and is currently waiting for the fetching to complete. Returns `false` otherwise.
|
||||
*/
|
||||
private(set) public var isPendingRefetch = false
|
||||
public private(set) var isPendingRefetch = false
|
||||
|
||||
/**
|
||||
Asks the `ListMonitor` to refetch its objects using the specified series of `FetchClause`s. Note that this method does not execute the fetch immediately; the actual fetching will happen after the `NSFetchedResultsController`'s last `controllerDidChangeContent(_:)` notification completes.
|
||||
|
||||
Reference in New Issue
Block a user