Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Search Feature: Remove filter of Workshop Day #571

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app-ios/Sources/Model/Selectable.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
public protocol Selectable: CaseIterable, Equatable, Identifiable, Hashable {
associatedtype Options: RandomAccessCollection = [Self] where Self == Self.Options.Element
static var options: Options { get }
var caseTitle: String { get }

}

public extension Selectable {
static var options: Options { allCases as! Options }
}
8 changes: 6 additions & 2 deletions app-ios/Sources/SearchFeature/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ public struct SearchView: View {
selection: T?,
defaultTitle: String,
onSelect: @escaping (T) -> Void
) -> some View where T.AllCases: RandomAccessCollection {
) -> some View {
Menu {
ForEach(T.allCases, id: \.id) { menuSelection in
ForEach(T.options, id: \.id) { menuSelection in
Button {
onSelect(menuSelection)
} label: {
Expand Down Expand Up @@ -171,6 +171,10 @@ extension DroidKaigi2024Day {
String(localized: "9/13", bundle: .module)
}
}

public static var options: [DroidKaigi2024Day] {
[.conferenceDay1, .conferenceDay2]
}
}

#if hasFeature(RetroactiveAttribute)
Expand Down
Loading