Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know menu open or not in swrevealviewcontroller in swift 2.0

Tags:

ios

swift2

I have made one app in ios. I have use swrevealviewcontroller for menu.I need keyboard disapper when menu open or not. So how to recognize menu is open or not?

like image 999
Kaushal Patel Avatar asked Jan 02 '26 03:01

Kaushal Patel


1 Answers

If you want to check the status of the SWRevealViewController in your code, check the frontViewPosition property of the SWRevealViewController

   if (self.revealViewController().frontViewPosition != FrontViewPosition.Left) { 
   // Do something 
   }

If you want to be notified for the menu toggle, implement the following SWRevealViewControllerDelegate methods in your delegate. (where you want to observe these changes)

- (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:(FrontViewPosition)position;
- (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position;
like image 189
Dhandapani Avatar answered Jan 04 '26 11:01

Dhandapani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!