Skip to content

Commit

Permalink
Merge pull request #571 from hicka04/ios-remove-workshop-day-from-sea…
Browse files Browse the repository at this point in the history
…rch-filter-options

[iOS] Search Feature: Remove filter of Workshop Day
  • Loading branch information
MrSmart00 authored Aug 17, 2024
2 parents a6f1fbf + c012472 commit e70bd92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
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

0 comments on commit e70bd92

Please sign in to comment.