Unwind segue from navigation back button in Swift

后端 未结 4 935
无人及你
无人及你 2020-12-14 19:15

I have a settings screen, in that I have a table cell. By clicking on that I take to another screen where user can choose an option and I want it back in the previous view c

4条回答
  •  孤城傲影
    2020-12-14 19:48

    Do the following in the view controller that has the back button

    Swift 3

    override func didMove(toParentViewController parent: UIViewController?) {
        if !(parent?.isEqual(self.parent) ?? false) {
            print("Parent view loaded")
        }
        super.didMove(toParentViewController: parent)
    }
    

提交回复
热议问题