Impressia/Vernissage/CoreData/AttachmentDataHandler.swift

20 lines
536 B
Swift
Raw Normal View History

2023-01-01 18:13:36 +01:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
// Licensed under the MIT License.
//
import Foundation
2023-01-02 08:11:38 +01:00
import CoreData
2023-01-01 18:13:36 +01:00
class AttachmentDataHandler {
2023-01-05 11:55:20 +01:00
public static let shared = AttachmentDataHandler()
private init() { }
2023-01-01 18:13:36 +01:00
2023-01-02 08:11:38 +01:00
func createAttachmnentDataEntity(viewContext: NSManagedObjectContext? = nil) -> AttachmentData {
let context = viewContext ?? CoreDataHandler.shared.container.viewContext
2023-01-01 18:13:36 +01:00
return AttachmentData(context: context)
}
}