OSDN Git Service

プロパティ名を変更
authormasakih <masakih@users.sourceforge.jp>
Wed, 14 Mar 2018 14:39:46 +0000 (23:39 +0900)
committermasakih <masakih@users.sourceforge.jp>
Sun, 18 Mar 2018 01:40:33 +0000 (10:40 +0900)
KCD/CoreDataCore.swift
KCD/MOCGenerator.swift
KCD/ServerDataStore.swift

index ebf5691..a8f3fa6 100644 (file)
@@ -16,7 +16,7 @@ struct CoreDataConfiguration {
     let type: String
     
     // try remake data file, if model file modified.
-    let tryRemake: Bool
+    let tryRemakeStoreFile: Bool
     
     private static let defaultOptions: [AnyHashable: Any] = [
         NSMigratePersistentStoresAutomaticallyOption: true,
@@ -27,13 +27,13 @@ struct CoreDataConfiguration {
          fileName: String? = nil,
          options: [AnyHashable: Any] = defaultOptions,
          type: String = NSSQLiteStoreType,
-         tryRemake: Bool = false) {
+         tryRemakeStoreFile: Bool = false) {
         
         self.modelName = modelName
         self.fileName = fileName ?? "\(modelName).storedata"
         self.options = options
         self.type = type
-        self.tryRemake = tryRemake
+        self.tryRemakeStoreFile = tryRemakeStoreFile
     }
 }
 
index e33cd4b..27d7a51 100644 (file)
@@ -86,7 +86,7 @@ final class MOCGenerator {
         } catch let error as NSError {
             
             // Data Modelが更新されていたらストアファイルを削除してもう一度
-            if config.tryRemake,
+            if config.tryRemakeStoreFile,
                 error.domain == NSCocoaErrorDomain,
                 isMigrationError(error.code) {
                 
index 7dbf50f..dd96414 100644 (file)
@@ -10,7 +10,7 @@ import Cocoa
 
 final class ServerDataStore: CoreDataManager {
     
-    static let core = CoreDataCore(CoreDataConfiguration("KCD", tryRemake: true))
+    static let core = CoreDataCore(CoreDataConfiguration("KCD", tryRemakeStoreFile: true))
     
     static let `default` = ServerDataStore(type: .reader)