I have multiple UITextView
instances in my UIViewController
and would like to save the typed-in text in Core Data
when the view controller's view disappears
or a specific button is clicked. Ideally, I would use the textViewDidEndEditing
delegate method to save the changes to Core Data but the problem is that if a user changes a text view and then hits the said button, this delegate method is not called. So how should I save the changes?
One option I can think of is to leverage textViewDidChange
- but that method is called each time a character is typed in. If I were to save the text to Core Data
within this method, wouldn't that be inefficient?
Are there other ways you can recommend for me to achieve this?