Swiftpack.co - 0x0001SUI/KeyboardState as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by 0x0001SUI.
0x0001SUI/KeyboardState v1.1.0
A property wrapper type that shows whether the keyboard is shown or hidden.
⭐️ 2
🕓 43 weeks ago
.package(url: "https://github.com/0x0001SUI/KeyboardState.git", from: "v1.1.0")


struct NoteEditor: View {
    @ObservedObject var note: Note
    @KeyboardState private var keyboardState: KeyboardVisibility
    @FocusState private var isFocused: Bool

    var body: some View {
        TextEditor(text: $note.text)
            .toolbar {
                ToolbarItem(placement: .navigationBarTrailing) {
                    if keyboardState == .visible {
                        Button {
                            isFocused = false
                        } label: {
                            Label("Hide Keyboard", systemImage: "keyboard.chevron.compact.down")


Stars: 2
Last commit: 43 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

43 weeks ago

Added missing states (hiding and showing).

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics