ios - NIMutableTableViewModel 错误 `AnyClass does not conform to NITableViewModelDelegate`

标签 ios swift nimbus nimbus-ios

在 ObjC 中,代码应该是这样的

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

在 swift

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

在 Swift 中,它给我错误 AnyClass does not conform to NITableViewModelDelegate 。事实上,类 NICellFactory 没有也不能显式地遵守协议(protocol) NITableViewModelDelegate。

还有其他方法吗?

最佳答案

想要解决方案的小伙伴可以看这个问题详情https://github.com/jverkoey/nimbus/issues/577

这是swift端口 https://github.com/NimbusKit/swift

相关代码在这里: TableCellFactory.swift

关于ios - NIMutableTableViewModel 错误 `AnyClass does not conform to NITableViewModelDelegate`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26904654/

相关文章:

ios - CATiledLayer 显示以前的图 block

java - JFileChooser 上的系统外观布局,但带有 nimbus 外观主题

swing - 如何在 JTextArea 中居中对齐文本?

swift - 如何在 SWIFTUI 中进行修剪旋转?

ios - 在 api 调用之前从核心数据表中删除数据在 swift 中不起作用

swift - 从无任务上下文创建常规或分离任务的区别?

iphone - 如何计算 CATextLayer 字符串的边界框?

ios - 为什么我不能选择 "Latest iOS"作为基础 SDK?

ios - 带有不受重力影响的 child 的 SKLabelNode - 不尊重 zPosition