Skip to content

Instantly share code, notes, and snippets.

@ttepasse
Last active August 29, 2015 14:09
Show Gist options
  • Save ttepasse/62eb9328c98e10dd7529 to your computer and use it in GitHub Desktop.
Save ttepasse/62eb9328c98e10dd7529 to your computer and use it in GitHub Desktop.
// Dein fehler: '[AnyObject]?' is not a subtype of 'Void'
// dismissViewControllerAnimated will eine Closure mit der Typ-Signatur () -> Void.
// Wenn die Closure nur aus einer Expression besteht, wie hier der Aufruf von popToViewController
// dann wird der Return Value dieser Expression automagisch als Return der Closure angenommen.
// popToViewController gibt [AnyObject]? zurück. Das ist nicht Void.
// Wie fixen? So sollte es gehen.
dismissViewControllerAnimated(true, completion: {
self.navController!.popToViewController(self.navController!.viewControllers[0] as UIViewController,
animated: true)
return // -> Void
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment