viewProvider(for:location:textContainer:)
Returns the text attachment view provider corresponding to the file type.
Declaration
func viewProvider(for parentView: NSView?, location: any NSTextLocation, textContainer: NSTextContainer?) -> NSTextAttachmentViewProvider?Parameters
- parentView:
The parent view.
- location:
An <Nstextlocation that indicates that start of the string.
- textContainer:
TheNstextcontainer that contains the source text.
Return Value
Discussion
The default implementation queries the text attachment view provider class using the textAttachmentViewProviderClass(forFileType:) method of NSTextAttachment. When non-nil, it instantiates a view, then, fills properties declared in NSTextAttachmentViewProvider if implemented.