Mercurial > public > geoquiz
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GeoQuiz/Logic/DataController.swift Wed Oct 19 10:04:17 2022 +0200 @@ -0,0 +1,21 @@ +// +// DataController.swift +// GeoQuiz +// +// Created by Dennis Concepción Martín on 19/10/22. +// + +import CoreData +import Foundation + +class DataController: ObservableObject { + let container = NSPersistentContainer(name: "GeoQuiz") + + init() { + container.loadPersistentStores { description, error in + if let error = error { + print("Core Data failed to load: \(error.localizedDescription)") + } + } + } +}