Reformatting

This commit is contained in:
Justin Mazzocchi 2020-08-08 17:08:06 -07:00
parent 25ed9d08fd
commit 5f9973352d
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
1 changed files with 5 additions and 4 deletions

View File

@ -8,7 +8,7 @@ import AppKit
import Kingfisher
extension NSMutableAttributedString {
func insert(emojis: [Emoji], onImageLoad: (() -> Void)?) {
func insert(emojis: [Emoji], onImageLoad: @escaping (() -> Void)) {
for emoji in emojis {
let token = ":\(emoji.shortcode):"
@ -18,10 +18,11 @@ extension NSMutableAttributedString {
replaceCharacters(in: NSRange(tokenRange, in: string), with: attachmentAttributedString)
KingfisherManager.shared.retrieveImage(with: emoji.url) { result in
guard case let .success(value) = result else { return }
KingfisherManager.shared.retrieveImage(with: emoji.url) {
guard case let .success(value) = $0 else { return }
attachment.image = value.image
onImageLoad?()
onImageLoad()
}
}
}