Slide 46
Slide 46 text
final class AttachmentViewProvider: NSTextAttachmentViewProvider {
override func loadView() {
view = PlayerView()
}
override func attachmentBounds(
for attributes: [NSAttributedString.Key : Any],
location: NSTextLocation,
textContainer: NSTextContainer?,
proposedLineFragment: CGRect,
position: CGPoint
) -> CGRect {
CGRect(
x: 0.0,
y: 0.0,
width: proposedLineFragment.width,
height: 100.0
)
}
}