콘텐츠 추가
This commit is contained in:
@@ -56,6 +56,10 @@ enum AppStep {
|
||||
|
||||
case createContent
|
||||
|
||||
case modifyContent(contentId: Int)
|
||||
|
||||
case contentDetail(contentId: Int)
|
||||
|
||||
case liveReservationComplete(response: MakeLiveReservationResponse)
|
||||
|
||||
case creatorDetail(userId: Int)
|
||||
|
34
SodaLive/Sources/App/ObjectBoxService.swift
Normal file
34
SodaLive/Sources/App/ObjectBoxService.swift
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// ObjectBoxService.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/08/11.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import ObjectBox
|
||||
|
||||
class ObjectBoxService {
|
||||
let store: Store!
|
||||
let playbackTrackingBox: Box<PlaybackTracking>
|
||||
|
||||
init() {
|
||||
let databaseName = "yozmlive"
|
||||
let appSupport = try! FileManager.default.url(for: .applicationSupportDirectory,
|
||||
in: .userDomainMask,
|
||||
appropriateFor: nil,
|
||||
create: true)
|
||||
.appendingPathComponent(Bundle.main.bundleIdentifier!)
|
||||
let directory = appSupport.appendingPathComponent(databaseName)
|
||||
try? FileManager.default.createDirectory(at: directory,
|
||||
withIntermediateDirectories: true,
|
||||
attributes: nil)
|
||||
|
||||
if try! Store.isOpen(directory: directory.path) {
|
||||
self.store = try! Store.attachTo(directory: directory.path)
|
||||
} else {
|
||||
self.store = try! Store(directoryPath: directory.path)
|
||||
}
|
||||
self.playbackTrackingBox = store.box(for: PlaybackTracking.self)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user