Swift Sliding Menu
1.) First, Download the SWRevealViewController library from github
2.) Inside the folder, movement the SWRevealViewController.h as well as SWRevealViewController.m to your project. Create a header file as well as insert the next line
#import "SWRevealViewController.h"
3.) You'll live on needing the next ViewControllers
4.) In the storyboard, pick out the sentiment which has a label SWRevealViewController as well as modify its degree to SWRevealViewController. Next, control-drag from SWRevealViewController to sw_rear.
Select the "reveal sentiment controller ready segue". Select the segue as well as modify its identifier to "sw_rear" nether the identity inspector.
Next, repeat the same procedures to connect SWRevealViewController alongside the navigation controller of the tidings sentiment controller. Again, pick out “reveal sentiment controller ready segue” when prompted.Set the identifier of the segue to “sw_front”.
5.) Inside the viewdidload of the swift file of sw_front, insert the next lines of code:
if self.revealViewController() != zero { menuButton.target = self.revealViewController() menuButton.action = "revealToggle:" self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer()) }
6.) To live on able to switch to unlike cell, drag to the navigation controller of the sentiment controllers as well as pick out the “reveal sentiment controller force controller” segue nether Selection Segue.
0 komentar:
Please comment if there are any that need to be asked.