From 4a332c7ffaa939e0178b06c27170c1e98ac68791 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 14 Jul 2024 20:13:57 -0700 Subject: [PATCH] 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 --- damus/Components/CustomPicker.swift | 20 +++++++------------ damus/ContentView.swift | 10 ++++++---- damus/Views/DirectMessagesView.swift | 12 +++++------ damus/Views/FollowingView.swift | 8 ++++---- .../Notifications/NotificationsView.swift | 16 +++++---------- damus/Views/Profile/ProfileView.swift | 8 ++++---- 6 files changed, 31 insertions(+), 43 deletions(-) diff --git a/damus/Components/CustomPicker.swift b/damus/Components/CustomPicker.swift index 7badc55f..454384d0 100644 --- a/damus/Components/CustomPicker.swift +++ b/damus/Components/CustomPicker.swift @@ -12,31 +12,25 @@ let RECTANGLE_GRADIENT = LinearGradient(gradient: Gradient(colors: [ DamusColors.blue ]), startPoint: .leading, endPoint: .trailing) -struct CustomPicker: View { +struct CustomPicker: View { + let tabs: [(String, SelectionValue)] @Environment(\.colorScheme) var colorScheme - + @Namespace var picker @Binding var selection: SelectionValue - @ViewBuilder let content: Content - + public var body: some View { - let contentMirror = Mirror(reflecting: content) - let blocksCount = Mirror(reflecting: contentMirror.descendant("value")!).children.count HStack { - ForEach(0..