-
Notifications
You must be signed in to change notification settings - Fork 163
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
cc49b3c
commit 67a472a
Showing
5 changed files
with
87 additions
and
75 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,35 @@ | ||
// | ||
// SearchTypes.swift | ||
// | ||
// | ||
// Created by Mohamed Afifi on 2023-12-16. | ||
// | ||
|
||
import Foundation | ||
|
||
enum SearchUIState { | ||
case entry | ||
case autocomplete | ||
case loading | ||
case searchResults | ||
} | ||
|
||
enum SearchTerm { | ||
case autocomplete(_ term: String) | ||
case noAction(_ term: String) | ||
|
||
// MARK: Internal | ||
|
||
var term: String { | ||
switch self { | ||
case .autocomplete(let term), .noAction(let term): return term | ||
} | ||
} | ||
|
||
var isAutocomplete: Bool { | ||
switch self { | ||
case .autocomplete: return true | ||
case .noAction: return false | ||
} | ||
} | ||
} |
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