keyboard with tableView

self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissMode.OnDrag
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(SearchVC.keyboardWillShow(_:)), name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(SearchVC.keyboardWillHide(_:)), name: UIKeyboardWillHideNotification, object: nil)
automaticallyAdjustsScrollViewInsets = false
func keyboardWillShow(notification: NSNotification) {
if !keyboardUp {

UIView.animateWithDuration(0.25) {
self.view.center = CGPoint(x: self.view.center.x, y: self.view.center.y - 220)
self.naviDown()

}
keyboardUp = true
}
}

func keyboardWillHide(notification: NSNotification) {
if keyboardUp {

UIView.animateWithDuration(0.25) {
self.view.center = CGPoint(x: self.view.center.x, y: self.view.center.y + 220)
self.naviUp()
}
keyboardUp = false
}
}

func naviDown() {
self.constrainNaviTop.constant = 220
self.view.layoutIfNeeded()
}

func naviUp() {
self.constrainNaviTop.constant = 0
self.view.layoutIfNeeded()
}
override func viewDidDisappear(animated: Bool) {
super.viewDidDisappear(animated)
NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillHideNotification, object: nil)
}