I found solution
var body: some View {
GeometryReader { _ in
//your view
}
.ignoresSafeArea(.keyboard, edges: isKeyboardVisible ? .top : .bottom)
}
For detecting if keyboard is visible or not you can use any solution that you like. as example https://stackoverflow.com/questions/65784294/how-to-detect-if-keyboard-is-present-in-swiftui
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: