目前,我唯一取得的成就是用
拆分它们 let mediaItem = ChatImageJSQPhoto(image: image)
let outgoingBool = chat.sender!.id != NetworkHelper.loggedInUser!.id
mediaItem.appliesMediaViewMaskAsOutgoing = outgoingBool
let photoMessage = JSQMessage(senderId: String(chat.sender!.id), senderDisplayName: chat.sender!.username, date: self.formatter.dateFromString(chat.dateTime), media: mediaItem)
Alamofire.request(.GET, chat.gift!.image)
.responseImage { response in
if let image = response.result.value {
mediaItem.image = image
dispatch_async(dispatch_get_main_queue(), {
self.collectionView.reloadData()
self.finishReceivingMessage()
})
}
}
self.messages.append(photoMessage)
//then get the message if it exists
if chat.desc.characters.count > 0 {
self.addMessage(String(chat.sender!.id), senderName: chat.sender!.username, text: chat.desc, date: chat.dateTime)
}
答案 0 :(得分:0)
您可以使用自动布局实现此目的。您不知道如何实施项目
<强> H:|[imageView]-10-[uiLabel]|
强>
有关自动布局可视化格式语言(VFL)的更多信息,请访问apple documenation