comparison GeoQuiz/Logic/DataController.swift @ 15:f1967f8cc67b

first iteration of core data
author Dennis C. M. <dennis@denniscm.com>
date Wed, 19 Oct 2022 10:04:17 +0200
parents
children
comparison
equal deleted inserted replaced
14:136928bae534 15:f1967f8cc67b
1 //
2 // DataController.swift
3 // GeoQuiz
4 //
5 // Created by Dennis Concepción Martín on 19/10/22.
6 //
7
8 import CoreData
9 import Foundation
10
11 class DataController: ObservableObject {
12 let container = NSPersistentContainer(name: "GeoQuiz")
13
14 init() {
15 container.loadPersistentStores { description, error in
16 if let error = error {
17 print("Core Data failed to load: \(error.localizedDescription)")
18 }
19 }
20 }
21 }