Roman Barzyczak Roman Barzyczak - 6 months ago 125
Swift Question

Swift 2 warning: Passing 2 arguments to a callee as a single tuple value is deprecated

I have code like this:

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
}
}


How can I solve this warning?

Answer

This warning is specified in here

Swift 3 will deprecate option of sending tuple as a argument. Try this one

func newAnswerWritingContent(jsonData: [String:AnyObject]) {
   if let userContent: (BRSLegacyUser, String) = CometHelper.createBRSAnwerFromWritingContent(jsonData) {
      let user = userContent.0
      let content = userContent.1
       newAnswerWritingContent?(user,content)
   }
}
Comments