Last active
August 29, 2015 14:09
-
-
Save ttepasse/62eb9328c98e10dd7529 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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