Reformatting
This commit is contained in:
parent
25ed9d08fd
commit
5f9973352d
|
@ -8,7 +8,7 @@ import AppKit
|
||||||
import Kingfisher
|
import Kingfisher
|
||||||
|
|
||||||
extension NSMutableAttributedString {
|
extension NSMutableAttributedString {
|
||||||
func insert(emojis: [Emoji], onImageLoad: (() -> Void)?) {
|
func insert(emojis: [Emoji], onImageLoad: @escaping (() -> Void)) {
|
||||||
for emoji in emojis {
|
for emoji in emojis {
|
||||||
let token = ":\(emoji.shortcode):"
|
let token = ":\(emoji.shortcode):"
|
||||||
|
|
||||||
|
@ -18,10 +18,11 @@ extension NSMutableAttributedString {
|
||||||
|
|
||||||
replaceCharacters(in: NSRange(tokenRange, in: string), with: attachmentAttributedString)
|
replaceCharacters(in: NSRange(tokenRange, in: string), with: attachmentAttributedString)
|
||||||
|
|
||||||
KingfisherManager.shared.retrieveImage(with: emoji.url) { result in
|
KingfisherManager.shared.retrieveImage(with: emoji.url) {
|
||||||
guard case let .success(value) = result else { return }
|
guard case let .success(value) = $0 else { return }
|
||||||
|
|
||||||
attachment.image = value.image
|
attachment.image = value.image
|
||||||
onImageLoad?()
|
onImageLoad()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue