Can an 'Unwind Segue' work between two storyboards connected by a storyboard reference?

前端 未结 3 1705
借酒劲吻你
借酒劲吻你 2020-12-09 04:49

In iOS 9, storyboards can be connected by a \'storyboard reference\' that links to a second storyboard by adding a storyboard reference and setting the \'referenced ID\' to

3条回答
  •  鱼传尺愫
    2020-12-09 05:01

    1) Add this method to your MainViewController

    // NEEDED! Do not delete!
    @IBAction func unwindToMasterViewController(_ segue : UIStoryboardSegue) {
      // Do nothing
    }
    2) In the Main storyboard, right-click on the Exit segue of the referenced storyboard and select unwindToMasterViewController

    3) Give the exit segue a name to reference it in code

    4) Call your exit segue from code

提交回复
热议问题