I have two view controller. suppose, viewcontroller1
and viewcontroller2
.
In viewcontroller1
I have a textview and a button. When I click textview keyboard open, and if press button keyboard dismiss nicely. I am using this code for dismiss keyboard.
[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder)
to:nil
from:nil
forEvent:nil];
but, when keyboard open, and I go to viewcontroller2
and then return to viewcontroller1
, in viewWillAppear method I use same code for dismissing keyboard, but keyboard not dismiss. I am so much astonished to see this. please help