BrowserTabDataBase.swift 626 Bytes
//
//  BrowserTab.swift
//  browser
//
//  Created by Artem Talko on 02.10.2023.
//


import UIKit
import Realm
import RealmSwift

class BrowserTabDataBase: Object {
    @Persisted(primaryKey: true) var tabId: String = UUID().uuidString
    @Persisted var tabTitle: String
    @Persisted var TabUrl: String
    @Persisted var snapshotImageData: Data?

    convenience init(tabTitle: String, snapshotImage: UIImage?, tabUrl: String) {
        self.init()
        self.tabTitle = tabTitle
        self.TabUrl = tabUrl
        if let image = snapshotImage {
            self.snapshotImageData = image.pngData()
        }
    }
}