shallow
shallow copied to clipboard
`UITextView` missing events for EditingStarted, EditingEnded.
I had to implement a delegate, which luckily was really easy in F#:
// Use delegate to display the placeholder message
text.Delegate <- { new UITextViewDelegate() with
member this.EditingStarted _ =
if text.Text = placeholder then
text.Text <- ""
text.TextColor <- UIColor.DarkTextColor
text.BecomeFirstResponder() |> ignore
member this.EditingEnded _ =
if text.Text = "" then
text.Text <- placeholder
text.TextColor <- placeholderColor
text.BecomeFirstResponder() |> ignore
}