Is there a way that I can return value for shouldPerformSegueWithIdentifier
method from my closure? Or should I do it differently?
override func shouldPerformSegueWithIdentifier(identifier: String?, sender: AnyObject?) -> Bool {
getDataFromSomewhere() { succeeded, data in
if succeeded {
// Should return true here
} else {
self.errorAlert("Error", message: "Can't get data...")
// Should return false here
}
}
}
shouldPerformSegueWithIdentifier
is a an override, so changing its signature will prevent the system calling it. – Hereditament