swift - 对于桥接的 Objective-C 方法,这个 Swift 名称宏中缺少什么?

标签 swift objective-c xcode bridging

Xcode 报告此警告:

parameter of 'swift_name' attribute must be a Swift function name string"

用于以下功能。我不知道我写错了什么。

+ (CGFloat *)feedDetailWithUpdate:(PostUpdate *)update
                     trackingInfo:(nullable TrackingInfo *)trackingInfo
              highlightedComments:(NSArray<FeedComment *> *)highlightedComments
NS_SWIFT_NAME(feedDetailWithUpdate(update:trackingInfo:highlightedComments));

最佳答案

我想通了,参数列表末尾少了一个冒号:

NS_SWIFT_NAME(feedDetailWithUpdate(update:trackingInfo:highlightedComments:));

关于swift - 对于桥接的 Objective-C 方法,这个 Swift 名称宏中缺少什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66214113/

相关文章:

xcode - 从 xcode 4.3.2 升级到 4.5.2 时出现错误

ios - 根据框架大小自动调整 UICollectionViewCell 中的单元格大小

swift - 如何制作方形视频?

ios - 从 AppDelegate 关闭 uiswitch

ios - 按下时为 UITextfield 执行操作

ios - 使UITableViewCell选择闪烁

objective-c - iMac 的位置管理器

iphone - 模态视图中的导航 Controller ?

ios - 如何让应用程序根据用户移动的距离更新服务器?

ios - swift 中 textview 字符串的 tapgesture