FWIW, the other sample project provided by Apple works after updating it to swift 6: https://developer.apple.com/documentation/photokit/implementing_an_inline_photos_picker
I took that project and changed it slowly to integrate into my project and it works.
Post
Replies
Boosts
Views
Activity
I'm getting a crash using PhotosPicker, and it can be reproduced using a sample project provided by Apple: https://developer.apple.com/documentation/photokit/bringing_photos_picker_to_your_swiftui_app
If you load that project and then change "Swift Language Version" to "Swift 6" in the Build Settings, when you come back from the photo picker the app crashes.
FWIW, this code seems to work for me as a work around for the defaultScrollAnchor
struct MyView : View {
@State private var scrollPosition = ScrollPosition()
var body: some View {
ScrollView {
LazyVStack {
// lots of data
}
}
.scrollPosition($scrollPosition, anchor: .bottom)
.onAppear {
scrollPosition.scrollTo(edge: .bottom)
}
}
}
I'm having the same problem. If I use a VStack it works, but then I have some performance issues loading into the list (because of how many items there are). Using a LazyVStack with the ScrollView and the defaultScrollAnchor with a lot of data leaves a blank window until I scroll up.