Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Escaping closure captures non-escaping parameter 'submit' #31

Closed
ardinh opened this issue Nov 20, 2024 · 3 comments
Closed

Error Escaping closure captures non-escaping parameter 'submit' #31

ardinh opened this issue Nov 20, 2024 · 3 comments

Comments

@ardinh
Copy link

ardinh commented Nov 20, 2024

hello, i found an error when using alternative direct use, when using function submit handler code error "Escaping closure captures non-escaping parameter 'submit' ". can you help me fix this?

the code is like this
`struct ContentView: View {
@State var text = "0"

var body: some View {
    TextField("", text: $text)
        .customKeyboard { textDocumentProxy, onSubmit, playFeedback in
            VStack {
                numberButton(text: "1", uiTextDocumentProxy: textDocumentProxy, playFeedback: playFeedback)
                numberButton(text: "2", uiTextDocumentProxy: textDocumentProxy, playFeedback: playFeedback)
                Button("DEL") {
                    textDocumentProxy.deleteBackward()
                    playFeedback?()
                    onSubmit()
                }
            }
        }
}

func numberButton(text: String, uiTextDocumentProxy: UITextDocumentProxy, playFeedback: (() -> ())?) -> some View {
    Button(text) {
        uiTextDocumentProxy.insertText(text)
        playFeedback?()
    }
}

}`

@paescebu
Copy link
Owner

Hi @ardinh,

What a great find! That was definitely an oversight from my side!
I pushed a new release just for you so that you are not blocked anymore by that issue!
https://github.com/paescebu/CustomKeyboardKit/releases/tag/1.1.1

Let me know if the issue is resolved, or feel free to close the issue yourself if it's resolved.
Thank you for your support!

Kind regards
Pascal

@paescebu
Copy link
Owner

Hey @ardinh
Did you have any chance to give it a go?

@paescebu
Copy link
Owner

Closed due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants