Swift 2.2でその作業:
var messages = [JSQMessage]()
//...
for i in 1...10 {
let sender = (i%2 == 0) ? "Server" : self.senderId
let messageContent = "Message nr. \(i)"
var message = JSQMessage(senderId: sender, displayName: sender, text: messageContent)
self.messages += [message] //Cannot convert value of type '[JSQMessage]' to expected argument type 'inout_'
}
Swift 3でエラーが発生しました。使ってみた
self.messages += [&message] // Type of expression is ambiguous without more context
直し方?