motion/input_helpers.rb
def handle_keyboard_will_hide(notification)
      return unless @table

      if UIEdgeInsetsEqualToEdgeInsets(@table.contentInset, UIEdgeInsetsZero)
        return
      end

      animationCurve = notification.userInfo.valueForKey(UIKeyboardAnimationCurveUserInfoKey)
      animationDuration = notification.userInfo.valueForKey(UIKeyboardAnimationDurationUserInfoKey)

      UIView.beginAnimations("changeTableViewContentInset", context:nil)
      UIView.setAnimationDuration(animationDuration)
      UIView.setAnimationCurve(animationCurve)

      @table.contentInset = UIEdgeInsetsZero;

      UIView.commitAnimations
    end
def handle_keyboard_will_hide(notification)
      return unless @table

      if UIEdgeInsetsEqualToEdgeInsets(@table.contentInset, UIEdgeInsetsZero)
        return
      end

      animationCurve = notification.userInfo.valueForKey(UIKeyboardAnimationCurveUserInfoKey)
      animationDuration = notification.userInfo.valueForKey(UIKeyboardAnimationDurationUserInfoKey)

      UIView.beginAnimations("changeTableViewContentInset", context:nil)
      UIView.setAnimationDuration(animationDuration)
      UIView.setAnimationCurve(animationCurve)

      @table.contentInset = UIEdgeInsetsZero;

      UIView.commitAnimations
    end
def handle_keyboard_will_hide ( notification ) return unless @table if UIEdgeInsetsEqualToEdgeInsets ( @table . contentInset , UIEdgeInsetsZero ) return end animationCurve = notification . userInfo . valueForKey ( UIKeyboardAnimationCurveUserInfoKey ) animationDuration = notification . userInfo . valueForKey ( UIKeyboardAnimationDurationUserInfoKey ) UIView . beginAnimations ( "changeTableViewContentInset" , context : nil ) UIView . setAnimationDuration ( animationDuration ) UIView . setAnimationCurve ( animationCurve ) @table . contentInset = UIEdgeInsetsZero ; UIView . commitAnimations end
Undo all the rejiggering when the keyboard slides
 down.

 You *must* handle the +UIKeyboardWillHideNotification+ and
 when you receive it, call this method to handle the keyboard
 hiding.
Undo all the rejiggering when the keyboard slides down .