ios - Swift: Scroll UITableView when keyboard appears -


i've found answers this, nothing working specific case.

i have uitableview dynamic prototyped cells. 1 of these cells contains uitextview, , there 1 of these , @ bottom. text view.

i can't connect text view outlet in controller because throws error (i'm assuming because there can multiple instances of text view, , can't mapped 1 outlet). can't make controller conform uitextview protocol.

is there simple , elegant solution this?

try observe keyboard appearing events in vc. this:

notificationcenter.default.addobserver(self, selector: #selector(scrolltotop(notification:)), name: .uikeyboardwillshow, object: nil) notificationcenter.default.addobserver(self, selector: #selector(scrolltobottom(notification:)), name: .uikeyboardwillhide, object: nil)  func scrolltotop(notification: nsnotification) {         //change tableview insets }   func scrolltobottom(notification: nsnotification) {           //change tableview insets  } 

Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -