File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Modules/Sources/WooFoundation/ViewModifiers
WooCommerce/Classes/Bookings/BookingList Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ public extension View {
1111 return self
1212 }
1313
14+ /// Applies modifiers within a closure.
15+ /// Helpful for setting different modifiers conditionally (e.g. OS versions).
16+ ///
17+ func apply< V: View > ( @ViewBuilder _ block: ( Self ) -> V ) -> V {
18+ block ( self )
19+ }
20+
1421 /// Applies the given transform if the given condition evaluates to `true`.
1522 /// - Parameters:
1623 /// - condition: The condition to evaluate.
Original file line number Diff line number Diff line change @@ -123,6 +123,16 @@ private extension BookingListView {
123123 . textCase ( nil )
124124 }
125125 }
126+ . apply {
127+ /// Plain list style in iOS prior to 26.0 comes with extra spacing at the top of header.
128+ /// Use grouped style for these versions instead.
129+ /// Grouped list style doesn't pin header at the top, we have to accept this.
130+ if #available( iOS 26 . 0 , * ) {
131+ $0. listStyle ( . plain)
132+ } else {
133+ $0. listStyle ( . grouped)
134+ }
135+ }
126136 . listStyle ( . grouped)
127137 . scrollContentBackground ( . hidden)
128138 . listSectionSeparator ( . hidden, edges: . top)
You can’t perform that action at this time.
0 commit comments