This commit is contained in:
John Rommel Estropia
2016-02-09 07:35:31 +09:00
parent f19a0d29eb
commit df866718cf
5 changed files with 72 additions and 7 deletions

View File

@@ -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 {

View 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)
}
}

View File

@@ -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?
}

View File

@@ -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.