-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1efa9e6
commit 2fb6c6d
Showing
10 changed files
with
158 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// AppNavigationState.swift | ||
// Ice | ||
// | ||
|
||
import Combine | ||
|
||
/// The model for app-wide navigation. | ||
@MainActor | ||
final class AppNavigationState: ObservableObject { | ||
@Published var appNavigationIdentifier: AppNavigationIdentifier = .idle | ||
@Published var settingsNavigationIdentifier: SettingsNavigationIdentifier = .general | ||
} |
10 changes: 10 additions & 0 deletions
10
Ice/Navigation/NavigationIdentifiers/AppNavigationIdentifier.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// AppNavigationIdentifier.swift | ||
// Ice | ||
// | ||
|
||
/// An identifier used for app-wide navigation. | ||
enum AppNavigationIdentifier: String, NavigationIdentifier { | ||
case idle | ||
case settings | ||
} |
20 changes: 20 additions & 0 deletions
20
Ice/Navigation/NavigationIdentifiers/NavigationIdentifier.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// NavigationIdentifier.swift | ||
// Ice | ||
// | ||
|
||
import SwiftUI | ||
|
||
/// A type that represents an identifier used for navigation in a user interface. | ||
protocol NavigationIdentifier: CaseIterable, Hashable, Identifiable, RawRepresentable { | ||
/// A localized description of the identifier that can be presented to the user. | ||
var localized: LocalizedStringKey { get } | ||
} | ||
|
||
extension NavigationIdentifier where ID == Int { | ||
var id: Int { hashValue } | ||
} | ||
|
||
extension NavigationIdentifier where RawValue == String { | ||
var localized: LocalizedStringKey { LocalizedStringKey(rawValue) } | ||
} |
15 changes: 15 additions & 0 deletions
15
Ice/Navigation/NavigationIdentifiers/SettingsNavigationIdentifier.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// SettingsNavigationIdentifier.swift | ||
// Ice | ||
// | ||
|
||
/// An identifier used for navigation in the settings interface. | ||
enum SettingsNavigationIdentifier: String, NavigationIdentifier { | ||
case general = "General" | ||
case menuBarItems = "Menu Bar Items" | ||
case menuBarAppearance = "Menu Bar Appearance" | ||
case hotkeys = "Hotkeys" | ||
case advanced = "Advanced" | ||
case updates = "Updates" | ||
case about = "About" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.