mirror of
https://github.com/modo-studio/SugarRecord.git
synced 2024-10-05 18:39:45 +03:00
Fix README.md "How to use" examples (#340)
This commit is contained in:
parent
9bb457b555
commit
7ce9913f8a
13
README.md
13
README.md
@ -63,9 +63,9 @@ A storage represents your database. The first step to start using SugarRecord is
|
||||
```swift
|
||||
// Initializing CoreDataDefaultStorage
|
||||
func coreDataStorage() -> CoreDataDefaultStorage {
|
||||
let store = CoreData.Store.Named("db")
|
||||
let bundle = Bundle(forClass: self.classForCoder())
|
||||
let model = CoreData.ObjectModel.merged([bundle])
|
||||
let store = CoreDataStore.named("db")
|
||||
let bundle = Bundle(for: self.classForCoder)
|
||||
let model = CoreDataObjectModel.merged([bundle])
|
||||
let defaultStorage = try! CoreDataDefaultStorage(store: store, model: model)
|
||||
return defaultStorage
|
||||
}
|
||||
@ -78,10 +78,11 @@ SugarRecord supports the integration of CoreData with iCloud. It's very easy to
|
||||
```swift
|
||||
// Initializes the CoreDataiCloudStorage
|
||||
func icloudStorage() -> CoreDataiCloudStorage {
|
||||
let bundle = Bundle(forClass: self.classForCoder())
|
||||
let model = CoreData.ObjectModel.merged([bundle])
|
||||
let bundle = Bundle(for: self.classForCoder)
|
||||
let model = CoreDataObjectModel.merged([bundle])
|
||||
let icloudConfig = CoreDataiCloudConfig(ubiquitousContentName: "MyDb", ubiquitousContentURL: "Path/", ubiquitousContainerIdentifier: "com.company.MyApp.anothercontainer")
|
||||
return CoreDataiCloudStorage(model: model, iCloud: icloudConfig)
|
||||
let icloudStorage = try! CoreDataiCloudStorage(model: model, iCloud: icloudConfig)
|
||||
return icloudStorage
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user