ios_dev | 2024-11-06 10:06:17 UTC | #1
Hey I have followed the instructions here: https://developer.genesys.cloud/commdigital/digital/webmessaging/mobile-messaging/messenger-mobile-sdk/ios/#4--using-the-messenger-ui-component-in-swiftui
To use the a variation of the iOS GCMessengerSDKSample with SwiftUI and I am seeing this odd display when the keyboard is displayed:
Is the issue with our code or the View we receive from:
func shouldPresentChatViewController(_ viewController: UINavigationController!)
Any ideas how to solve this?
Thanks
Andras_Solyom | 2024-11-06 14:19:12 UTC | #2
Hello,
SwiftUI has built in keyboard avoidance (unlike UIKit) which moves the view up when the keyboard is visible. As this avoidance is already implemented internally by our SDK it needs to be disabled in SwiftUI, otherwise the chat view is moved up too much. This can be done by using this view modifier:
chatHandler.chatView
.ignoresSafeArea(.keyboard)
We will update the developer documentation to include this.
Best Regards, Andras Solyom
ios_dev | 2024-11-06 15:10:01 UTC | #3
Awesome, thank you
system | 2024-12-06 15:10:13 UTC | #4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 30224