Exploring text field and text view delegate methods
Currently, there are a couple of issues with the Add New Journal Entry screen. The first issue is that it’s not possible to dismiss the software keyboard once it appears on the screen. The second issue is that you can click the Save button even when the text field and text view are empty.
To make it easier to work with text fields, Apple has implemented UITextFieldDelegate
, a protocol declaring a set of optional methods to manage the editing and validation of text in a text field object. Apple has also implemented UITextViewDelegate
, a protocol declaring methods for receiving editing-related messages for text view objects.
You can learn more about the UITextFieldDelegate
protocol at this link: https://developer.apple.com/documentation/uikit/uitextfielddelegate.
You can learn more about the UITextViewDelegate
protocol at this link: https://developer.apple.com/documentation/uikit/uitextviewdelegate.