-2
喜我想去與條件下一個視圖中textfiled 2進入secondview和tetxtfiled 3去時thirdview變化與條件
我不想navgation控制或標籤視圖
class ViewController: UIViewController {
@IBOutlet weak var text: UITextField!
@IBAction func nextview(sender: UIButton) {
if text.text == "2"{
let secondView = self.storyboard?.instantiateViewControllerWithIdentifier("second") as! SecondView
self.navigationController?.pushViewController(secondView, animated: true)
}
else{
let thirdPageView = self.storyboard?.instantiateViewControllerWithIdentifier("third") as! ThirdView
self.navigationController?.pushViewController(thirdPageView, animated: true)
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
我也使用prepersguewithidentifire,但不工作! 我很困惑
其中是self.storyboard的初始化? –
嗨。在mainstoryboard - >故事板識別 –
你是什麼意思的「不工作」? – Sweeper