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
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