Impressia/Vernissage/Models/NavigationMenuItemDetails.s...

27 lines
646 B
Swift
Raw Normal View History

2023-04-18 20:34:59 +02:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
// Licensed under the Apache License 2.0.
//
import Foundation
2023-04-20 15:03:43 +02:00
import SwiftUI
2023-04-18 20:34:59 +02:00
class NavigationMenuItemDetails: ObservableObject, Identifiable {
2023-04-21 16:58:52 +02:00
@Published var title: LocalizedStringKey
@Published var image: String
2023-04-18 20:34:59 +02:00
2023-04-20 15:03:43 +02:00
@Published var viewMode: MainView.ViewMode {
didSet {
self.title = viewMode.title
self.image = viewMode.image
}
}
2023-04-21 16:58:52 +02:00
init(viewMode: MainView.ViewMode) {
2023-04-18 20:34:59 +02:00
self.viewMode = viewMode
2023-04-20 15:03:43 +02:00
self.title = viewMode.title
self.image = viewMode.image
2023-04-18 20:34:59 +02:00
}
}