Properties3
Is BaseNo
Icon
Order
30KelyphosPanel is the protocol that panel tab enums conform to. It combines an identifier, display metadata, and a SwiftUI view body.
Declaration
protocol KelyphosPanel: Identifiable, CaseIterable, View {
var id: String { get }
var title: String { get }
var systemImage: String { get }
}
Conformance Requirements
| Requirement | Notes |
|---|---|
id: String | Must be nonisolated — used for UserDefaults persistence keys |
title: String | Must be nonisolated — displayed in tab bar and keybindings overlay |
systemImage: String | Must be nonisolated — SF Symbol name |
body: some View | The panel's content view |
CaseIterable | Required so Array(MyTab.allCases) works in KelyphosShellConfiguration |
Example
enum MyNavigatorTab: String, KelyphosPanel, CaseIterable {
case files, search, bookmarks
nonisolated var id: String { rawValue }
nonisolated var title: String {
switch self {
case .files: "Files"
case .search: "Search"
case .bookmarks: "Bookmarks"
}
}
nonisolated var systemImage: String {
switch self {
case .files: "folder"
case .search: "magnifyingglass"
case .bookmarks: "bookmark"
}
}
var body: some View {
switch self {
case .files: FilesNavigatorView()
case .search: SearchNavigatorView()
case .bookmarks: BookmarksNavigatorView()
}
}
}
