Created
June 6, 2012 16:04
-
-
Save pchw/2882922 to your computer and use it in GitHub Desktop.
call resignFirstResponder for nil
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NilClass | |
def method_missing(method, *args, &block) | |
if method.to_s == "resignFirstResponder" | |
return nil | |
else | |
super | |
end | |
end | |
end | |
# send resignFirstResponder with nil check to all UIView | |
views.each do |view| | |
view.resignFirstResponder | |
end | |
nil.becomeFirstResponder # NoMethodException as ever |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment