Closed benlachman closed 10 years ago
FYI, before merging (dur) I implemented the exact same abstraction you did in a method named -setPlaceholderVisibleForText:
. You might want to consider renaming -togglePlaceholderViewForText:
to something a bit more descriptive since "toggle" implies a specific action that goes back and forth regardless of the passed arguments while set<whatever>Visible…
might be more descriptive. Apple also uses set<whatever>Visible
in several of their APIs.
great stuff. thanks!
btw: i added tests for the placeholder sync logic
-- Adds attributedPlaceholder property so that the placeholder may be matched to the main text view in the case that it uses UITextView's attributedText property for mixed formatting. -- Fixes issue with placeholder incorrectly being visible after setting attributedText on main text view by observing attributedText property on the main text view. -- Toggles placeholder visibility on becomeFirstResponder (catches the previous bug and any additional edge cases).