prepareForSegue and PerformSegueWithIdentifier sender

后端 未结 6 931
执笔经年
执笔经年 2021-02-03 13:18

I am wondering about how the functions in the title work and also about the sender parameter.

Lets say a button click calls the performSegue method, does that also call

6条回答
  •  长情又很酷
    2021-02-03 14:06

    while sending any object to the particular object to another view controller by using perform segue with an identifier, Please follow the steps #Swift4

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "Detailed_Live_poll"{
            let destinationNavigationController = segue.destination as! UINavigationController
            let targetController = destinationNavigationController.topViewController as! NewLivePollViewController
            targetController.dictQuestInf = sender as! NSDictionary
        }
    }
    

提交回复
热议问题