Post

Replies

Boosts

Views

Activity

Reply to Keep ScrollView position when adding items on the top
So I had a similar problem. I had a calendar-like view where the latest data is at the bottom. By default, it had 12 items in a LazyVGrid (3 rows of 4 items). You could tap "show more" to expand the size of the view to 600 in height, and also make it scrollable with the top view triggering a fetch of the next page of results. The problem was, the act of resizing this view, and triggering the next page of results was causing the scroll view to jump to the top, rather than staying at the bottom. So essentially it would start loading all pages infinitely. .scrollPosition and the ScrollViewProxy do not seem to work, because at the time of hitting "show more" the bottom is already visible, so the act of changing the scroll position does nothing. The only workaround I found here was to add a delay long enough for the resize animation and for enough results to load to prevent another page load from triggering. Unfortunately, this was not at all reliable. The only fix I have found was to use .defaultScrollAnchor(.bottom) which seems to cause the scroll view to default to the bottom when it's being redrawn rather than to the top. But unfortunately, we are on iOS 16, so I can't use that modifier either.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’25
Reply to The new navigationLinkIndicatorVisibility modifier crashes on < iOS 26
Seeing this crash in beta 8 (Xcode beta 7). Symbol not found: _$s7SwiftUI17EnvironmentValuesV33_navigationIndicatorVisibilityABIAA0G0OvpMV Referenced from: <35BAAD44-14F4-3B6C-8568-3E8B57A526ED> My call site: var allMerchantsSection: some View { Section { ForEach(model.paginatedMerchants.items) { merchant in NavigationLink(value: MerchantDestination.merchant(merchant)) { CardCell( image: .remote(url: merchant.info.bannerUrl), text: merchant.info.merchantName, description: nil, chipText: nil ) .navigationLinkIndicatorVisibility(.hidden) } .listRowBackground(Color.backgroundPrimary) .listRowSeparator(.hidden) .onAppear { if model.canLoadMore, merchant == model.paginatedMerchants.items.last { model.paginatedMerchants.currentPage += 1 } } } } header: { Text("All Merchants") } } made a feedback report: FB20108722
Topic: UI Frameworks SubTopic: SwiftUI
Sep ’25