paescebu / CustomKeyboardKit

Creating custom In App Keyboards with SwiftUI has never been easier!
GNU General Public License v3.0
201 stars 20 forks source link

Missing important keys #6

Closed shahriar-ax closed 1 year ago

shahriar-ax commented 1 year ago

in custom keyboard has no delete button, case change button & no dismiss or done button

paescebu commented 1 year ago

Hi @shahriar-ax,

That's correct. Everything that is text manipulation you have to implement yourself by manipulating the string using the UITextDocumentProxy closure parameter object.

To give you an example for the logic for a button you add the the following View for deleting the character left of the cursor:

var deleteButton: some View {
        Button {
            textProxy.deleteBackward()
        } label: {
            Text("DEL")
        }
}

For the case change you need to implement your own business logic to accomplish that for your keyboard (SwiftUI gives you all the tools :-) ), and for the done action, you call the submit closure parameter and provide the keyboard the submit action from outside via the onSubmitCustomKeyboard(:) View Modifier, and you decide what happens upon that.

Let me know if you need further assistance!

paescebu commented 1 year ago

Closed due to inactivity