simplify CustomPicker and fix ios18 runtime error

This fixes a reflection runtime error for our custom picker

Fixes: https://github.com/damus-io/damus/issues/2332
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-07-14 20:13:57 -07:00
parent 616f730ae5
commit 4a332c7ffa
6 changed files with 31 additions and 43 deletions

View File

@@ -127,10 +127,12 @@ struct ContentView: View {
}
.safeAreaInset(edge: .top, spacing: 0) {
VStack(spacing: 0) {
CustomPicker(selection: $filter_state, content: {
Text("Notes", comment: "Label for filter for seeing only notes (instead of notes and replies).").tag(FilterState.posts)
Text("Notes & Replies", comment: "Label for filter for seeing notes and replies (instead of only notes).").tag(FilterState.posts_and_replies)
})
CustomPicker(tabs:
[("Notes", FilterState.posts),
("Notes & Replies", FilterState.posts_and_replies)
],
selection: $filter_state)
Divider()
.frame(height: 1)
}