Ambiguous reference to member 'insert(_:completionHandler:)' xcode 8 beta 2

797 Views Asked by At

Hello with the new beta 2 i got a new problem that i couldn't solve.

var message = MSMessage() 
var template = MSMessageTemplateLayout()

viewDidLoad() {    
     if let filePath2 =
     Bundle.main().pathForResource("synth", ofType: "wav") {
         let fileUrl = NSURL(string: filePath2)
         let URL2 = fileUrl as! URL
         template.mediaFileURL = URL2
     }

 message.layout = template

 guard let conversation = activeConversation else {

 fatalError("Expected a conversation") }  conversation.insert(message,
     localizedChangeDescription: nil) { error in
     if let error = error {
         print(error)
     }
 }
}

anyone else have the same problem? there's something wrong with conversation

1

There are 1 best solutions below

1
On BEST ANSWER

There is no MSConversation method insert(_:localizedChangeDescription:). Look at the docs and see.

Did you mean insert(_:completionHandler:)? If so, just delete the second parameter.