2021-02-22 07:10:34 +00:00
|
|
|
// Copyright © 2021 Metabolist. All rights reserved.
|
|
|
|
|
2021-02-22 23:59:33 +00:00
|
|
|
import SDWebImage
|
2021-02-22 07:10:34 +00:00
|
|
|
import UIKit
|
|
|
|
|
|
|
|
final class AnimatedTextAttachment: NSTextAttachment {
|
2021-02-22 23:59:33 +00:00
|
|
|
var imageURL: URL?
|
|
|
|
var imageView = SDAnimatedImageView()
|
2021-02-22 07:10:34 +00:00
|
|
|
var imageBounds: CGRect?
|
|
|
|
|
|
|
|
override func image(forBounds imageBounds: CGRect,
|
|
|
|
textContainer: NSTextContainer?,
|
|
|
|
characterIndex charIndex: Int) -> UIImage? {
|
|
|
|
self.imageBounds = imageBounds
|
|
|
|
|
|
|
|
return nil // rendered by AnimatingLayoutManager or AnimatedAttachmentLabel
|
|
|
|
}
|
|
|
|
}
|