Post

Replies

Boosts

Views

Activity

UIAlertAction handler
I am writing UIAlert and UIAlertAction and I want to add performSeque to handler in UIAlertAction but I keep getting this error: "Cannot use instance member 'performSegue' within property initializer; property initializers run before 'self' is available" here is my code let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert)    let action = UIAlertAction(title: "Title", style: .default, handler: { action in     performSegue(withIdentifier: "goToVC", sender: nil)   })
4
0
2.6k
Nov ’20