Rev 17 | Rev 23 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
//// NotificationListViewModel.swift// twogetskills//// Created by Efrain Yanez Recanatini on 7/31/22.//import Foundationimport SwiftUIclass NotificationListViewModel: ObservableObject{@Published public var notifications = [UserNotificationModel]()init() {fetchAll()}func fetchAll(){let userNotificationDao = UserNotificationDao.sharedInstancenotifications = userNotificationDao.selectAll();}public func removeItem(id: Int) {let userNotificationDao = UserNotificationDao.sharedInstanceuserNotificationDao.remove(id: id)notifications.remove(at: notifications.firstIndex(where: { $0.id == id })!)}}