我在 Objective-C 项目中使用 Xcode 10.1 并使用 SWIFT_VERSION 3.0。下面的代码在 Swift 3 上运行良好。
RichTextEditor.swift:
init(frame: CGRect, editAccess: Int) {
super.init(frame:frame)
}
Objective-C 类调用上述方法:
self.rchTextControl = [[RichTextEditor alloc] initWithFrame:CGRectMake(2, cellRowHeight, tableView.tableView.bounds.size.width-4, cellMessageHeight-cellRowHeight) editAccess:[sectionCtrlEditAccessValue intValue]];
上面的 Objective-C 代码正在使用 Swift 3,一旦我将其更改为 SWIFT_VERSION 4,就会发生以下错误。
我该如何解决这个问题?我在谷歌上搜索,但我找不到解决方案。