我有这样的代码:
func newContent(jsonData: [String:AnyObject]) {
if let userContent: (User, String) = Helper.createUserFromWritingContent(jsonData) {
newContent?(userContent) // here is the warning: Passing 2 arguments to a callee as a single tuple value is deprecated
}
}
我该如何解决这个警告?
最佳答案
此警告在 here 中指定
Swift 3 将弃用将元组作为参数发送的选项。试试这个
func newAnswerWritingContent(jsonData: [String:AnyObject]) {
if let userContent: (BRSLegacyUser, String) = CometHelper.createBRSAnwerFromWritingContent(jsonData) {
let user = userContent.0
let content = userContent.1
newAnswerWritingContent?(user,content)
}
}
关于ios - swift 2 警告 : Passing 2 arguments to a callee as a single tuple value is deprecated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37588857/