Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Swift compilation issue that took some of my time today. Solution: https://gist.github.com/cdzombak/431cea0a4c0ced8042a5
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
})
}
// ...
}
Owner

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