Skip to content

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

License

Notifications You must be signed in to change notification settings

FiveSheepCo/KeyboardAlignedViews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages