2015-06-08 23 views

回答

0

在按一下按鈕,就可以出現或推視圖控制器如果您有賽格瑞連接它,你可以這樣做:

if(easySelected) 
    [self performSegueWithIdentifier:@"easyOne" sender:self]; 
else if 
    ... 

如果你有導航控制器或想要現在它可以做:

UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; 
EasyViewConroller *cont = [story instantiateInitialViewController]; 
// or EasyViewConroller *cont = [story instantiateViewControllerWithIdentifier:@"YourIdent"]; 
// in former solution you have to set that identifier in the code/storyboard 

// navigation/push 
self.navigationController pushViewController:cont animated:YES]; 

// if you want to present it 
[self presentViewController:cont animated:YES completion:nil]; 

編輯:

if(easySelected){ 
    self.performSegueWithIdentifier("easyOne" sender:self) 
{ 
else if{ 
    ... 
} 

//If you have navigation controller or want to present it you can do: 
var tempStory = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()) 
var tempVC = tempStory.instantiateInitialViewController() as! EasyViewController 

//present 
self.presentViewController(tempVC, animated: true) 

//push 
self.navigationController?.pushViewController(tempVC, animated: true) 
+0

尼克Catib謝謝你,但你可以使用快捷 –

+0

當然,給我爲10分鐘展示給我 – Miknash

+0

很抱歉,如果你把它給了我兩個可能性還是什麼我沒undersatnd ? –

相關問題