Post

Replies

Boosts

Views

Activity

[Critical Issue] Content with variable height in a LazyVStack inside a ScrollView causes stuttering / jumping
My goal is to create a chat view in SwiftUI. This requires creating a ScrollView with content of varying heights . After extensive debugging, I've determined that if you have views within a LazyVStack inside of a ScrollView that do not have a fixed height, it will stutter when you scroll to the top of the view. –––– PROJECT: Download this project and try for yourself struct ContentView: View { @State var items: [String] = MockData.randomMessages(count: 100) var body: some View { VStack { Button("Shuffle items") { items = MockData.randomMessages(count: 100) } ScrollView { LazyVStack(spacing: 10) { ForEach(Array(items.enumerated()), id: \.offset) { index, item in Text(item) .background(colors.randomElement()!) } } } } } } My conclusion right now is that LazyVStack only works with child views that have fixed height. This issue alone prevents SwiftUI from being production ready. Has anyone else tackled this?
7
7
9.3k
Oct ’23
Dismissing sheet with keyboard up shifts view down partially under the keyboard
I've seen this in multiple places now, but when I have a keyboard up, and then I present a modal (i.e. UIImagePickerController or PHPickerViewController) and hit "Cancel", it shifts the view down by ~30 pixels, and it becomes partially covered by the keyboard. The weird thing is, if I swipe down the UIImagePicker camera, it restores the frame just fine. So it seems to only happen when dismissing a sheet without a gesture. Could it be a bad interaction with UIViewControllerRepresentable? This is a bad bug if you're trying to have a textfield stay affixed to the top of the keyboard. For now, I've just resignedFirstResponder before pulling up the keyboard.
0
0
799
Jul ’21
[Critical Issue] Content with variable height in a LazyVStack inside a ScrollView causes stuttering / jumping
My goal is to create a chat view in SwiftUI. This requires creating a ScrollView with content of varying heights . After extensive debugging, I've determined that if you have views within a LazyVStack inside of a ScrollView that do not have a fixed height, it will stutter when you scroll to the top of the view. –––– PROJECT: Download this project and try for yourself struct ContentView: View { @State var items: [String] = MockData.randomMessages(count: 100) var body: some View { VStack { Button("Shuffle items") { items = MockData.randomMessages(count: 100) } ScrollView { LazyVStack(spacing: 10) { ForEach(Array(items.enumerated()), id: \.offset) { index, item in Text(item) .background(colors.randomElement()!) } } } } } } My conclusion right now is that LazyVStack only works with child views that have fixed height. This issue alone prevents SwiftUI from being production ready. Has anyone else tackled this?
Replies
7
Boosts
7
Views
9.3k
Activity
Oct ’23
Dismissing sheet with keyboard up shifts view down partially under the keyboard
I've seen this in multiple places now, but when I have a keyboard up, and then I present a modal (i.e. UIImagePickerController or PHPickerViewController) and hit "Cancel", it shifts the view down by ~30 pixels, and it becomes partially covered by the keyboard. The weird thing is, if I swipe down the UIImagePicker camera, it restores the frame just fine. So it seems to only happen when dismissing a sheet without a gesture. Could it be a bad interaction with UIViewControllerRepresentable? This is a bad bug if you're trying to have a textfield stay affixed to the top of the keyboard. For now, I've just resignedFirstResponder before pulling up the keyboard.
Replies
0
Boosts
0
Views
799
Activity
Jul ’21
App crashes immediately on latest iOS 15 beta (19A5297e)
My app was working perfectly fine yesterday (on the previous iOS 15 beta). I updated the operating system and now it just crashes immediately with: EXC_BAD_ACCESS (code=1, address=0x0) No further information. Anyone else experiencing this?
Replies
1
Boosts
0
Views
754
Activity
Jul ’21