mirror of
https://github.com/yattee/yattee.git
synced 2025-10-11 09:58:14 +00:00
Locations manifest, reorganized instances settings
This commit is contained in:
18
Model/SettingsModel.swift
Normal file
18
Model/SettingsModel.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
class SettingsModel: ObservableObject {
|
||||
@Published var presentingAlert = false
|
||||
@Published var alert = Alert(title: Text("Error"))
|
||||
|
||||
func presentAlert(title: String, message: String? = nil) {
|
||||
let message = message.isNil ? nil : Text(message!)
|
||||
alert = Alert(title: Text(title), message: message)
|
||||
presentingAlert = true
|
||||
}
|
||||
|
||||
func presentAlert(_ alert: Alert) {
|
||||
self.alert = alert
|
||||
presentingAlert = true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user