Mercurial > public > lazybear
view LazyBear/HUDManager.swift @ 246:35be981ccb31
Implementing CustomAction view
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Wed, 10 Mar 2021 21:19:28 +0100 |
parents | bba05cb7d62f |
children |
line wrap: on
line source
// // HUDManager.swift // LazyBear // // Created by Dennis Concepción Martín on 21/2/21. // import SwiftUI enum HudType { case notification, action } class HudManager: ObservableObject { @Published var showNotification = false @Published var showAction = false func selectHud(type: HudType) { if type == .notification { self.showNotification = true // Dimiss after time DispatchQueue.main.asyncAfter(deadline: .now() + 2) { self.showNotification = false } } else if type == .action { self.showAction = true } } }