On iOS 16.3 the ScrollView
component can enable paging by setting the following:
UIScrollView.appearance().isPagingEnabled = true
However, after updating to iOS 16.4, this no longer enables paging on the ScrollView
. Are there any workarounds to make this solution work? or are there alternative ways to build vertical paging in SwiftUI? I’m familiar with workarounds using TabView
but I cannot use that in this project for other reasons.
2
Answers
Try to use CollectionView wrapper.
you can follow this link already implemented.
Horizontal/Vertical paging in iOS 17
From iOS 17, you don’t need to tweak the UIKit appearance. All you need to do is applying the following modifier on the
ScrollView
:This works on both
horizontal
andvertical
scrollViews