Thanks for share all your thoughts and experience with us. I loved how you solved the "scroll down" idea. That was awesome!
@johnsorensen46963 жыл бұрын
How are you handling scrolling the messages up when the keyboard is summoned?
@ortbri3 жыл бұрын
man, you do amazing stuff. I appreciate the vids
@MohammedHussain-uf5uo Жыл бұрын
Thanks for the trick.But i need to scroll up when there is more content to load from server. How can i achieve that efficiently.
@tariqAlmazyad3 жыл бұрын
What a clover solution . What I was thinking for this issue is to make it as the .id(vm.messages.last ?? .init(// whatever an object) ) and then make the scrollViewProxy.scrollTo(to the last message) haven't thought about the DispatchQueue part 😅.
@piyusharmaus3 жыл бұрын
While keyboard is presented every time we push the chat view controller the chat list doesnt scroll to the end of the last chat above the keyboard. if we put delay for scrolling to the last then it works.
@LetsBuildThatApp3 жыл бұрын
Thats a good question, I would suggest listening for keyboardWillShow through NotificationCenter. Perhaps I'll make a video on this.
@piyusharmaus3 жыл бұрын
@@LetsBuildThatApp Thanks Brian. I tried using the same but still it gets stuck randomly if we keep doing hide/unhide. ScrollViewReader { reader in ScrollView(.vertical, showsIndicators: false) { ForEach(chats) { chat in ChatCell(chat: chat) .id(chat.id) } .onReceive(viewModel.$chats) { chats in withAnimation { reader.scrollTo(chats.last?.id) } } .onChange(of: keyboard.height) { height in withAnimation { keyboardOffset = height reader.scrollTo(chats.last?.id) } } } } Here keyboard is the ObservableObject object that listens for hide/show keyboard notifications.
@0xifarouk3 жыл бұрын
@@LetsBuildThatApp Check my comment it has a simpler solution.