簡體   English   中英

SWRevealViewController with StoryBoard with storyboard Identifier in Swift 不繼續如何做到這一點

[英]SWRevealViewController with StoryBoard with storyboard Identifier in Swift not segue how to do that

SWRevealViewController如何在swift中實現帶有故事板標識符的故事板而不是segue請幫助我

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardNibName" bundle:nil];
TempViewController *myVC = (TempViewController *)[storyboard instantiateViewControllerWithIdentifier:@"identifier"];
UIViewController *frontViewController = myVC;
RearViewController *rearViewController = [[RearViewController alloc] init];
UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController];
UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController];
SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];
revealController.delegate = self;
self.viewController = revealController;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];

迅速:

 let storyboard = UIStoryboard(name: "Main", bundle: nil)
 let vc = storyboard.instantiateViewControllerWithIdentifier("TARGET_VIEW_CONTROLLER") as! UIViewController
 var rvc:SWRevealViewController = self.revealViewController() as SWRevealViewController
 rvc.pushFrontViewController(vc, animated: true)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM