Package apple.uikit.protocol
Interface NSTextAttachmentContainer
-
- All Known Implementing Classes:
NSTextAttachment
public interface NSTextAttachmentContainerThis protocol defines the interface to attachment objects from NSLayoutManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CGRectattachmentBoundsForTextContainerProposedLineFragmentGlyphPositionCharacterIndex(@Nullable NSTextContainer textContainer, CGRect lineFrag, CGPoint position, long charIndex)Returns the layout bounds to the layout manager.@Nullable UIImageimageForBoundsTextContainerCharacterIndex(CGRect imageBounds, @Nullable NSTextContainer textContainer, long charIndex)Returns the image object rendered by NSLayoutManager at imageBounds inside textContainer.
-
-
-
Method Detail
-
attachmentBoundsForTextContainerProposedLineFragmentGlyphPositionCharacterIndex
CGRect attachmentBoundsForTextContainerProposedLineFragmentGlyphPositionCharacterIndex(@Nullable @Nullable NSTextContainer textContainer, CGRect lineFrag, CGPoint position, long charIndex)
Returns the layout bounds to the layout manager. The bounds origin is interpreted to match position inside lineFrag. The NSTextAttachment implementation returns -bounds if not CGRectZero; otherwise, it derives the bounds value from -[image size]. Conforming objects can implement more sophisticated logic for negotiating the frame size based on the available container space and proposed line fragment rect. API-Since: 7.0
-
imageForBoundsTextContainerCharacterIndex
@Nullable @Nullable UIImage imageForBoundsTextContainerCharacterIndex(CGRect imageBounds, @Nullable @Nullable NSTextContainer textContainer, long charIndex)
Returns the image object rendered by NSLayoutManager at imageBounds inside textContainer. It should return an image appropriate for the target rendering context derived by arguments to this method. The NSTextAttachment implementation returns -image when non-nil. If -image==nil, it returns an image based on -contents and -fileType properties. API-Since: 7.0
-
-