Post

Replies

Boosts

Views

Activity

Reply to Scroll to Bottom of List in iOS 16 Beta / Xcode 14 Beta 3
I am using ScrollView instead of List inside ScrollViewReader and the scrolling does not work since iOS16.0. In 16.0, it seems to work when I added Spacer after ScrollVIew {} within ScrollViewReader ScrollViewReader { VStack { ScrollView { content } if #available(iOS 16.0, *) { Spacer() } } } In iOS16.1, the scrolling does not work again. This time, I managed to workaround by keeping the Spacer in the above code and updating the scroll anchor to ".top" (was using .bottom anchor before). Over the past iOS versions, I had to adapt the anchor in order to get it to work for some versions. I hope Apple developer can be more consistent in making the scroll behaviour in future. scroll.scrollTo(ANCHOR_NAME, anchor: .iOS15 ? .none : (.iOS16plus ? .top : .bottom)) extension Bool {     static var iOS15: Bool {         if #available(iOS 16, *) {             return false         } else if #available(iOS 15, *) {             return true         }         return false     }     static var iOS16plus: Bool {         guard #available(iOS 16, *) else {             return false         }         return true     } }
Oct ’22