Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit acae7d4

Browse files
committed
Revert "Revert "Return things to be ObjC compatible""
This reverts commit ff694e7.
1 parent ff694e7 commit acae7d4

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

Source/DATAStack.swift

+17-13
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,23 @@ import CoreData
9292
super.init()
9393
}
9494

95+
/**
96+
Initializes a DATAStack using the provided model name.
97+
- parameter modelName: The name of your Core Data model (xcdatamodeld).
98+
*/
99+
@objc public init(modelName: String) {
100+
self.modelName = modelName
101+
self.model = NSManagedObjectModel(bundle: self.modelBundle, name: self.modelName)
102+
103+
super.init()
104+
}
105+
95106
/**
96107
Initializes a DATAStack using the provided model name.
97108
- parameter modelName: The name of your Core Data model (xcdatamodeld).
98109
- parameter isExcludedFromBackup: Flag to indicate if the data store should be excluded from backup. Default set to true.
99110
*/
100-
@objc public init(modelName: String, isExcludedFromBackup: Bool = true) {
111+
@objc public init(modelName: String, isExcludedFromBackup: Bool) {
101112
self.modelName = modelName
102113
self.isExcludedFromBackup = isExcludedFromBackup
103114
self.model = NSManagedObjectModel(bundle: self.modelBundle, name: self.modelName)
@@ -110,12 +121,10 @@ import CoreData
110121
- parameter modelName: The name of your Core Data model (xcdatamodeld).
111122
- parameter storeType: The store type to be used, you have .InMemory and .SQLite, the first one is memory
112123
based and doesn't save to disk, while the second one creates a .sqlite file and stores things there.
113-
- parameter isExcludedFromBackup: Flag to indicate if the data store should be excluded from backup. Only applies to sqlite stores. Default set to true.
114124
*/
115-
@objc public init(modelName: String, storeType: DATAStackStoreType, isExcludedFromBackup: Bool = true) {
125+
@objc public init(modelName: String, storeType: DATAStackStoreType) {
116126
self.modelName = modelName
117127
self.storeType = storeType
118-
self.isExcludedFromBackup = isExcludedFromBackup
119128
self.model = NSManagedObjectModel(bundle: self.modelBundle, name: self.modelName)
120129

121130
super.init()
@@ -129,13 +138,11 @@ import CoreData
129138
are located.
130139
- parameter storeType: The store type to be used, you have .InMemory and .SQLite, the first one is memory
131140
based and doesn't save to disk, while the second one creates a .sqlite file and stores things there.
132-
- parameter isExcludedFromBackup: Flag to indicate if the data store should be excluded from backup. Only applies to sqlite stores. Default set to true.
133141
*/
134-
@objc public init(modelName: String, bundle: Bundle, storeType: DATAStackStoreType, isExcludedFromBackup: Bool = true) {
142+
@objc public init(modelName: String, bundle: Bundle, storeType: DATAStackStoreType) {
135143
self.modelName = modelName
136144
self.modelBundle = bundle
137145
self.storeType = storeType
138-
self.isExcludedFromBackup = isExcludedFromBackup
139146
self.model = NSManagedObjectModel(bundle: self.modelBundle, name: self.modelName)
140147

141148
super.init()
@@ -154,12 +161,11 @@ import CoreData
154161
change that.
155162
- parameter isExcludedFromBackup: Flag to indicate if the data store should be excluded from backup. Only applies to sqlite stores. Default set to true.
156163
*/
157-
@objc public init(modelName: String, bundle: Bundle, storeType: DATAStackStoreType, storeName: String, isExcludedFromBackup: Bool = true) {
164+
@objc public init(modelName: String, bundle: Bundle, storeType: DATAStackStoreType, storeName: String) {
158165
self.modelName = modelName
159166
self.modelBundle = bundle
160167
self.storeType = storeType
161168
self.storeName = storeName
162-
self.isExcludedFromBackup = isExcludedFromBackup
163169
self.model = NSManagedObjectModel(bundle: self.modelBundle, name: self.modelName)
164170

165171
super.init()
@@ -179,13 +185,12 @@ import CoreData
179185
- parameter containerURL: The container URL for the sqlite file when a store type of SQLite is used.
180186
- parameter isExcludedFromBackup: Flag to indicate if the data store should be excluded from backup. Only applies to sqlite stores. Default set to true.
181187
*/
182-
@objc public init(modelName: String, bundle: Bundle, storeType: DATAStackStoreType, storeName: String, containerURL: URL, isExcludedFromBackup: Bool = true) {
188+
@objc public init(modelName: String, bundle: Bundle, storeType: DATAStackStoreType, storeName: String, containerURL: URL) {
183189
self.modelName = modelName
184190
self.modelBundle = bundle
185191
self.storeType = storeType
186192
self.storeName = storeName
187193
self.containerURL = containerURL
188-
self.isExcludedFromBackup = isExcludedFromBackup
189194
self.model = NSManagedObjectModel(bundle: self.modelBundle, name: self.modelName)
190195

191196
super.init()
@@ -198,10 +203,9 @@ import CoreData
198203
based and doesn't save to disk, while the second one creates a .sqlite file and stores things there.
199204
- parameter isExcludedFromBackup: Flag to indicate if the data store should be excluded from backup. Only applies to sqlite stores. Default set to true
200205
*/
201-
@objc public init(model: NSManagedObjectModel, storeType: DATAStackStoreType, isExcludedFromBackup: Bool = true) {
206+
@objc public init(model: NSManagedObjectModel, storeType: DATAStackStoreType) {
202207
self.model = model
203208
self.storeType = storeType
204-
self.isExcludedFromBackup = isExcludedFromBackup
205209

206210
let bundle = Bundle.main
207211
if let bundleName = bundle.infoDictionary?["CFBundleName"] as? String {

0 commit comments

Comments
 (0)