我有一个 SWRevealViewController
的例子来自 github。
现在我想了解,如何切换我的独立UIViewController
到另一个,其中包括 SWRevealViewController
.
我在某处读到这应该可行:
- (IBAction)action:(UIButton *)sender {
SWRevealViewController *swcontroller = self.revealViewController;
if (swcontroller) {
self.revealViewController.frontViewController = [[UIViewController alloc] init];
}
}
我从我的
UIButton
创建了一个模态序列至SWRevealViewController
.但它不起作用。
有人可以举个例子吗?
最佳答案
根据我的信息,您需要在 SWRevealViewController 中手动推送或弹出您的 View Controller 。如下所示,试试这个..
- (IBAction)btnActionSalesQuotation:(id)sender{
SWRevealViewController *revealview = self.revealViewController;
SalesQuotationsViewController *Gosalequo=[[SalesQuotationsViewController alloc]initWithNibName:@"SalesQuotationsViewController" bundle:nil];
[revealview pushFrontViewController:Gosalequo animated:YES];
}
关于iOS:如何从一个 UIViewController 切换到另一个,包括在 SWRevealViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32464534/