[英]SWRevealController Switching Views
我在項目中設置了SWRevealController,並遵循了一個查看教程。 問題是,當我單擊RevealControllerView頁面中的表視圖中的項目時,我無法弄清楚如何切換到另一個視圖。
我試着用這個:
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:newFrontController];
[revealController pushFrontViewController:navigationController animated:YES];
但是,當我使用此代碼時,我得到一個帶有黑色視圖頁面的空導航控制器。 該代碼似乎在profileViewController中運行,但是此視圖負擔很大。
這是我的故事板。 我希望他們單擊表中的項目,然后轉到ProfileViewController視圖。
使用“ SWRevealViewControllerSeguePushController” Segue將Menucontroller與您的下一個導航控制器/視圖控制器連接。
=>對於每個ViewController,您都需要自己的segue!
進行正確的選擇
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { switch(indexPath.row){ case 0: performSegueWithIdentifier("goto_test1", sender: self) break case 1: performSegueWithIdentifier("goto_test2", sender: self) break case 2: performSegueWithIdentifier("goto_test3", sender: self) break default: break } }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.