Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.42 KB

File metadata and controls

36 lines (25 loc) · 1.42 KB

KeyboardAlignedViews ⌨️

Quintschaf_Badge LICENSE_BADGE

KeyboardAlignedViews is a Swift Package that alignes SwiftUI Views with the iOS keyboard, both during animation and when the user drags the keyboard.

Description

In standard SwiftUI, the animation of the safe area insets and the keyboard is not properly aligned. Also, when the .scrollDismissesKeyboard(.interactively) interaction never adjusts the safe area, leaving users with strange unfilled areas of their screens.

KeyboardAlignedViews solves both problems, providing proper user interaction and animation tracking.

Example Code

Chat-style view with footer that contains a resizable text field

KAScrollViewWithTextViewFooter(placeholder: "placeholder", text: $message) {
    // scroll view content
} footer: { textView in
    textView
        .padding(8)
        .background(Color.gray)
}

TODO

  • Chat-style view where a footer below the main scroll view contains a resizable text field.
  • More generic usage possibility, where the developer can use a custom text view.