Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Swift compilation issue that took some of my time today. Solution:
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
// ...

This comment has been minimized.

Copy link
Owner Author

@cdzombak cdzombak commented Jan 22, 2015

This turned out to be because Void != Void?. See the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment