I'm new in stackoverflow, I have a problem with new swift code. I have custom the return button on keyboard with "Done", but when I tap on it, don't befall anything... How can I hide the keyboard on tap it? I have added a code (found on this site) for hide the keyboard when you tap somewhere ,not in the keyboard, but I can't custom it with tap on "done" button... Thank you before!!
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- gactions CLI crashes on Windows when uploading goo
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
The protocol methods have new signatures (Swift 4.1). IE:
As the protocol methods are optional, using a wrong signature will silently fail.
can be replaced by
This will create the necessary connections between your View, its component and will make the textFieldShouldReturn method work as expected.
Yo need to implement delegate method which is called when you hit done button:
You also need to conform to UITextFieldDelegate protocol:
The last thing is set up your class to be a text field delegate: