發表文章

目前顯示的是 10月, 2018的文章

iOS - 如何透過interface builder讓不同Storyboard上的ViewController進行Segue

圖片
New Project會預設建立Main.storyboard , 我們另外再建立一個新的storyboard 新的storyboard取名為Segue.storyboard 在 Segue.sotryboard拉一個 ViewController 並設定Storyboard ID, 這邊我設定為 SegueViewController 回到Main.storyboard, 也拉一個ViewController, 並在ViewController裡面拉一個Button 點選Button我們預期會切換至Segue.storyboard的SegueViewController 使用 Storyboard Reference 可以達到我們的目的  拖拉 Storyboard Reference 至介面上, 並設定Reference info: Storyboard 和 Referenced ID ( ViewController的Storyboard ID ) 接著點選Button按著Ctrl並拖拉至Storyboard Reference建立Segue 這樣就完成了