How to pass values from a Pop Up View Controller to the Previous View Controller?

前端 未结 3 2125
星月不相逢
星月不相逢 2021-01-26 06:04

So In my 1stViewController I have this code:

@IBAction func colorDropdown(_ sender: Any) {
    self.popUpColorPicker()
}

func popUpColorPicker() {
    let popOv         


        
3条回答
  •  梦谈多话
    2021-01-26 06:29

    You can achieve this by either using delegate or completion handler.

    Just create a delegate to handle your data on dismissing the second VC.

    **

    OR

    **

    Write a completion handler closure to get back those values in your first view controller.

提交回复
热议问题