Until SwiftUI gives us Accessory buttons for the keyboard, It looks like the best option is to use a UIViewRepresentable. My goal is to still have a cancel / clear / done button on top of the keyboard. The buttons show up on the keyboard, but when clicked do nothing. The textFieldShouldReturn is called and works properly. What am I missing? Oh, and I know the functions don't actually do anything but print to the console, but I can get that working.
It seems like you're missing some of the conceptual basics regarding Cocoa's target-action system. The
But since you don't seem to have much experience with target-action, I suggest you take a look at the "new"
Target-action is of course still a very valid approach, just throught I'd throw this here for completeness.
SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.