Created
January 22, 2015 00:53
-
-
Save cdzombak/eec288f79d2e012e3730 to your computer and use it in GitHub Desktop.
Swift compilation issue that took some of my time today. Solution: https://gist.github.com/cdzombak/431cea0a4c0ced8042a5
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
public class Router : NSObject { | |
typealias VCPushBlock = (UIViewController) -> (Void) | |
init(context: NSManagedObjectContext, pushBlock: VCPushBlock) { | |
// ... | |
} | |
convenience init(context: NSManagedObjectContext, owningViewController: UIViewController) { | |
self.init(context: context, pushBlock: { | |
owningViewController.navigationController?.pushViewController($0, animated: true) | |
// compiler error on previous line: Could not find an overload for 'init' that accepts the supplied arguments | |
}) | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This turned out to be because
Void
!=Void?
. See the solution.