The QLPreviewProvider will be available in macOS 12. Although currently it is not documented, I guess it will share the similar design with QLThumbnailProvider, so we could expect a providePreview function that accepts a handler of QLPreviewReply.
Migrating to QLPreviewProvider might solve issues like #12. The border is in some view which is not accessible at the time when preparePreviewOfFile is invoked. Note that at this time we can only access (NSNextStepFrameViewBridge -> QLUIServiceView -> self.view) from superview, and none of them features a border. The outer view lost track of the content size so an ugly border is placed around the image.
The QLPreviewProvider will be available in macOS 12. Although currently it is not documented, I guess it will share the similar design with QLThumbnailProvider, so we could expect a
providePreview
function that accepts a handler ofQLPreviewReply
.The shape of
QLPreviewReply
is here: https://developer.apple.com/documentation/quicklook/qlpreviewreply It accepts a content size and bitmap data.Migrating to QLPreviewProvider might solve issues like #12. The border is in some view which is not accessible at the time when
preparePreviewOfFile
is invoked. Note that at this time we can only access (NSNextStepFrameViewBridge -> QLUIServiceView -> self.view) fromsuperview
, and none of them features a border. The outer view lost track of the content size so an ugly border is placed around the image.