ios - Changing tableview height in swift -


i want change tableview when keyboard appears screen in swift. because if don't update height, bottom messages hides under keyboard. here screenshots:

before:

enter image description here

after:

enter image description here

you can see in screenshots, tableview still under keyboard. used following code , didn't work.

    func keyboardwillshow(notification: nsnotification) {         var info = notification.userinfo!         var keyboardframe: cgrect = (info[uikeyboardframeenduserinfokey] as! nsvalue).cgrectvalue()         self.tableview.frame.size.height=self.tableview.frame.size.height-keyboardframe.size.height         self.view.layoutifneeded()         uiview.animatewithduration(0.2) {             self.bottomcons.constant = keyboardframe.size.height //this line textbox , button. unrelated tableview.             self.view.layoutifneeded()         } } 

why tableview height not changing? how can fix it?


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -