Reputation: 1173
I have a weird case where I'm using the awesome SWRevealViewController from John Lluch to have 2 side navigation controllers (like the Facebook app) that slide out to the left and the right when a UIBarButtonItem is touched.
However - I need the front view controller to make sure to resign first responder whenever these actions happen, but the associated actions for those bar buttons happen in another View Controller class.
I need to either:
Can you resign first responder for one view from another view controller?
Upvotes: 1
Views: 794
Reputation: 241
you can do it using NSNotificationCenter as below.
//.m file:
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(LoadTableBasedOnCorner:) name:@"LoadTable" object:nil];
in which class you use above addObserver, you have to implement that method.
//.m file from where you want to send action, call method as below.
[[NSNotificationCenter defaultCenter] postNotificationName:@"LoadTable" object:nil];
Upvotes: 2