2015-11-02 50 views
-1

我正在關注多視圖應用程序的教程,它試圖讓我編寫根視圖控制器。我輸入了他們給出的確切代碼,但是我在一行中得到了連續的語句錯誤。這裏是我的代碼:連續聲明錯誤。試圖編寫根視圖控制器

blueViewController = storyboard?.instantiateViewControllerWithIdentifier(" Blue") as BlueViewController blueViewController.view.frame = view.frame switchViewController(from: nil, to: blueViewController) 
+3

看起來像你只需要在不同的語句之間的一些換行。恩。第一個應該在'BlueViewController'之後 – thelaws

回答

1

它應該是這樣的:

blueViewController = storyboard?.instantiateViewControllerWithIdentifier(" Blue") as BlueViewController 
blueViewController.view.frame = view.frame 
switchViewController(from: nil, to: blueViewController)