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
Post a Comment