keyboard - how to detect which UIViewObject is tapped in swift? -
i have uitextview in tableviewcell , trying save text. did textviewdidendediting save data. added gesture detect tap , hidekeyboard each tap. when user tap 1 textview other, keyboard gets closed , open again. don't like. thinking hidekeyboard if current tap not on textview. please me doing using swift.
tapping outside close keyboard difficult.
- you try put gesture specific areas , not textfields, difficult because need set more geastures probably
- try find out if tap gesture located in view , if happens on textfield.... not cool
- throw away geasture. tableviews activate dismiss keyboard on drag. common behavior removing it. close keyboard when pressing return. delegate call textview function "textfieldshouldreturn" should call [textview resignfirstresponder]. or add custom keyboard accessory view has done button.
on third case dont have fight , hack. feel free correct me :)
Comments
Post a Comment