Open3ヶ月前にコメント追加4ScrollView の使い方SwiftUIykws3ヶ月前https://developer.apple.com/documentation/swiftui/scrollview ykws3ヶ月前UIKit でできていたことが SwiftUI だと実現できないと思っていたが、大体できそう https://developer.apple.com/documentation/uikit/uiscrollview ykws3ヶ月前選択中の View を取得するのに ScrollView の中では Lazy 系を利用する https://developer.apple.com/documentation/swiftui/view/scrollposition(id:anchor:) iOS 17.5 限定かもしれないが、 Lazy 系ではない Stack だと scrollPosition が発火しない ykws3ヶ月前UIScrollView のように無制限にスクロールさせるには .never を指定する https://developer.apple.com/documentation/swiftui/viewalignedscrolltargetbehavior/limitbehavior/never
ykws3ヶ月前UIKit でできていたことが SwiftUI だと実現できないと思っていたが、大体できそう https://developer.apple.com/documentation/uikit/uiscrollview
ykws3ヶ月前選択中の View を取得するのに ScrollView の中では Lazy 系を利用する https://developer.apple.com/documentation/swiftui/view/scrollposition(id:anchor:) iOS 17.5 限定かもしれないが、 Lazy 系ではない Stack だと scrollPosition が発火しない
ykws3ヶ月前UIScrollView のように無制限にスクロールさせるには .never を指定する https://developer.apple.com/documentation/swiftui/viewalignedscrolltargetbehavior/limitbehavior/never