code to hide keyboard from rmq.app added

This commit is contained in:
Gant
2015-04-04 14:40:01 -05:00
parent b682fa7ff6
commit e551377d5d

View File

@@ -32,6 +32,19 @@ module RubyMotionQuery
UIApplication.sharedApplication.delegate
end
# @return [UIApplication]
def get
UIApplication.sharedApplication
end
# Returns boolean of success of hiding
# @return [Boolean]
def hide_keyboard
self.get.sendAction(:resignFirstResponder, to:nil, from:nil, forEvent:nil)
end
alias :resign_responders :hide_keyboard
alias :end_editing :hide_keyboard
# @return [Symbol] Environment the app is running it
def environment
@_environment ||= RUBYMOTION_ENV.to_sym