What is Nostr?
David Bureš /
npub1zl9…dnmj
2023-05-31 11:14:49

David Bureš on Nostr: Just discovered a weird SwiftUI quirk: When you have a `ScrollView` with the ...

Just discovered a weird SwiftUI quirk:

When you have a `ScrollView` with the `.refreshable` modifier, and then have another `ScrollView` in a `.safeAreaInset` on the `ScrollView` parent, the `ScrollView` in `.safeAreaInset` still triggers a refresh

Code example:
`var body: some View {`
`VStack {`
`ScrollView {`
`(code)`
`}`
`.refreshable {`
`(code)`
`}`
`}`
`.safeAreaInset(edge: .bottom) {`
`ScrollView {`
`(this also triggers the refresh)`
`}`
`}`
`}`

#SwiftUI #swift
Author Public Key
npub1zl99ghn2xqnyffuf3hrgvtj39wuc0jqtz0g8hul4cfzgufxmnd0slddnmj