Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SWRevealViewController push Segue

I am trying to use a SWrevealViewController for sidemenu . One of the options on it is "User Profile" . Since I access user's profile from various other views , I would like to have to have a push segue to this VC. However , a push segue is not working from SWRevealViewController to UserProfileVC.

Can anyone suggest how I may use a push sugue from SWRevealVC?

like image 885
Rhiya Avatar asked Jun 23 '26 13:06

Rhiya


2 Answers

Here's my solution:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil]
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"YOUR_VC_STORYBOARD_ID"];

SWRevealViewControllerSeguePushController *segue = [[SWRevealViewControllerSeguePushController alloc] initWithIdentifier:@"ANY_ID" source:self destination:vc];
[segue perform];
like image 189
Atrox111 Avatar answered Jun 25 '26 02:06

Atrox111


Swift version will be

let vc = self.storyboard?.instantiateViewControllerWithIdentifier("LoginRoot") as! UINavigationController
let  segue = SWRevealViewControllerSeguePushController.init(identifier: SWSegueRearIdentifier, source: self, destination: vc)
segue.perform()

Navigation controller is UIViewcontroller. i used navigation controller otherwise use UIViewController object.

like image 44
Avijit Nagare Avatar answered Jun 25 '26 04:06

Avijit Nagare