non-nominal type X does not support explicit initialization
Please check :
In your code you are doing like this C : MainViewControllerInterface, C : UIViewController
.
It is treating C
as ViewController, then there is no init
in ViewController like init(modelView: M)
thats why its throwing error
public class Other<C, M> : NSObject where C : MainViewControllerInterface, M : MainControllerToModelInterface, C.MODELVIEW == M { var c : C? override init() { let m = M() self.c = C(modelView: m) super.init() }}