Error for NIMutableTableViewModel `AnyClass does not conform to NITableViewModelDelegate`

80 views Asked by At

In ObjC the code would be like

self.tableModel = [[NIMutableTableViewModel alloc] initWithDelegate:(id)[NICellFactory class]];

In Swift

 self.tableModel = NIMutableTableViewModel(delegate:NICellFactory.classForCoder())

In Swift, It gives me error AnyClass does not conform to NITableViewModelDelegate . In fact the class NICellFactory doesn't and can't conform to the protocol NITableViewModelDelegate Explicitly.

Is there an alternate way ?

1

There are 1 answers

0
aelam On

Guys who want the solution can see this issue details https://github.com/jverkoey/nimbus/issues/577

And this is swift port https://github.com/NimbusKit/swift

Relevant code here: TableCellFactory.swift