1

I need resignFirstResponder when a page slide with ECSlidingViewController.

If i use UIPanGestureRecognizer for that. Thats override ECSlidingViewController and cant slide page after use that.

Rugmangathan
  • 3,186
  • 6
  • 33
  • 44
Can Ürek
  • 641
  • 12
  • 24

3 Answers3

5

You don't need to change the existing code. Instead, you should observe one of the notification names used by ECSlidingViewController, like ECSlidingViewUnderLeftWillAppear. To register, do the following on the initialization of your view controller:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slidingViewUnderLeftWillAppear:) name:ECSlidingViewUnderLeftWillAppear object:nil];

Then, implement a method like this one:

- (void)slidingViewUnderLeftWillAppear:(NSNotification *)notification {
    [self.view endEditing:YES];
}

Hope this helps!

leoformaggio
  • 450
  • 5
  • 12
1

And i found a way myself. May be anyone need that like me.

Thats the solution:

Found that row in ECSlidingViewController.m file

-(void)updateTopViewHorizontalCenterWithRecognizer:(UIPanGestureRecognizer *)
recognizer

and add that row

[self.view endEditing:TRUE];
Can Ürek
  • 641
  • 12
  • 24
0

if anyone is using "SWRevealViewController" you can add

[self.view endEditing:YES];

under

  • (void)revealToggleAnimated:(BOOL)animated

and it will work like a treat!

Mou某
  • 556
  • 3
  • 10
  • 32