mirror of
https://github.com/metabolist/metatext.git
synced 2024-05-18 16:28:21 +00:00
19 lines
550 B
Swift
19 lines
550 B
Swift
// Copyright © 2021 Metabolist. All rights reserved.
|
|
|
|
import SDWebImage
|
|
import UIKit
|
|
|
|
final class AnimatedTextAttachment: NSTextAttachment {
|
|
var imageURL: URL?
|
|
var imageView = SDAnimatedImageView()
|
|
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
|
|
}
|
|
}
|