-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the current UI @State. It simplifies this so that more may use it. Nice clean up.
- Loading branch information
Showing
5 changed files
with
131 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// ArchiveActivity.swift | ||
// site | ||
// | ||
// Created by Greg Bolsinga on 10/4/24. | ||
// | ||
|
||
import Foundation | ||
|
||
enum ArchiveActivity: Equatable { | ||
/// Nothing is active. Only possible on iOS or tvOS | ||
case none | ||
/// Just a category is selected. | ||
case category(ArchiveCategory) | ||
/// This path is the top of the navigation stack. | ||
case path(ArchivePath) | ||
} | ||
|
||
extension ArchiveActivity { | ||
var isCategory: Bool { | ||
if case .category(_) = self { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
var isPath: Bool { | ||
if case .path(_) = self { | ||
return true | ||
} | ||
return false | ||
} | ||
} | ||
|
||
extension ArchiveActivity: CustomStringConvertible { | ||
var description: String { | ||
switch self { | ||
case .none: | ||
"none" | ||
case .category(let archiveCategory): | ||
"category: \(archiveCategory.rawValue)" | ||
case .path(let archivePath): | ||
"path: \(archivePath.formatted(.json))" | ||
} | ||
} | ||
} |
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