Xcode 8 beta 6 UIActivityItemProvider 错误与@objc 兼容性

Xcode 8 beta 6 UIActivityItemProvider error with @objc compatibility

尝试在 Xcode 8 beta 6 中实现 UIActivityItemProvider。将此方法从字符串参数更改为 UIActivityType 后,现在出现此错误:

Method cannot be an @objc override because the type of the parameter 2 cannot be represented in Objective-C.

这是一个错误吗?有解决方法吗?

这是我们的代码

class NotificationUIActivityItemProvider : UIActivityItemProvider {

let subject : String
let text : String

init(subject: String, text: String) {

    self.subject = subject
    self.text = text
    super.init(placeholderItem: subject)
}

override public var item: Any { return text }

override func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivityType?) -> String {
    if activityType == .mail {
        return subject
    } else {
        return ""
    }
}

}

在我们解决了更多 Xcode 8 beta 6 错误后,现在可以使用了。