I'm the first iPhone developer. My problem is that I want to run 'performSegue
' in the function. Works correctly within a typical button function. But I want to do it in a function. What should I do?
@IBAction func nextButtonFuc(_ sender: UIButton) {
...
performSegue(withIdentifier: "moveScreen", sender: self) // it's worked
}
But it get Error
@IBAction func nextButtonFuc(_ sender: UIButton) {
...
networkingCallback(objectvalue!,object,sender)
}
...
func networkingCallback( _ objectvalue: String,_ object: Any,_ send: UIButton) {
performSegue(withIdentifier: "moveScreen", sender: send) //Error
self.performSegue(withIdentifier: "moveScreen", sender: self) //Error
self.performSegue(withIdentifier: "moveScreen", sender: send) //Error
}
How can I solve this problem?
performSegue(withIdentifier: "moveScreen", sender: send)
Error is Implicit use of 'self' in closure; use 'self.' to make capture semantics explicit
self.performSegue(withIdentifier: "moveScreen", sender: send) Error
Thread 18: signal SIGABRT
Thanks in advance