Posts

Showing posts with the label chat

Updating image in Chat bubble using Chatto library ios

Updating image in Chat bubble using Chatto library ios I have existing Model where I am adding Chatto for UI so I am able to create a message with placeholder but unable to figure out the best way to change the same after download. Library Link https://github.com/badoo/Chatto i am using chatto test app with DemoPhotoMessageModel. then i use the follwing to add var imgMess = DemoPhotoMessageModel(messageModel: messageModel, imageSize: placeholder.size, image: placeholder) self.slidingWindow.insertItem(imgMess, position: .bottom) self.delegate?.chatDataSourceDidUpdate(self) ImageDownloader.default.downloadImage(with: downloadURL, options: , progressBlock: nil) {[unowned self] (image, error, url, data) in print("Downloaded Image: (image)") if let img = image, let imgData = UIImagePNGRepresentation(img){ imgMess.setImage(img: img) //I updated the default implementation changing the image from var ...