How does one display a new view controller in the same Mac window?

后端 未结 3 1192
名媛妹妹
名媛妹妹 2020-12-14 01:39

I\'m fairly new to Mac development and am slightly confused by the new \"storyboard\" feature in Xcode 6. What I\'m trying to do is segue from one view controller to another

3条回答
  •  我在风中等你
    2020-12-14 02:12

    Simple way with no segues involved to replace the current view controller in the same window:

    if let myViewController = self.storyboard?.instantiateController(withIdentifier: "MyViewController") as? MyViewController {
        self.view.window?.contentViewController = myViewController
    }
    

提交回复
热议问题