Package apple.quicklook.protocol
Interface QLPreviewingController
-
public interface QLPreviewingControllerThe controller that implements the QLPreviewingController protocol must at least implement one of the two following methods: -[QLPreviewingController preparePreviewOfSearchableItemWithIdentifier:queryString:completionHandler:], to generate previews for Spotlight searchable items. -[QLPreviewingController preparePreviewOfFileAtURL:completionHandler:], to generate previews for file URLs. The main preview should be presented by the view controller implementing QLPreviewingController. Avoid presenting additional view controllers over your QLPreviewingController. For Catalyst compatibility, avoid using gesture recognizers that take interactions over large portions of the view to avoid collisions with standard macOS preview behaviors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceQLPreviewingController.Block_preparePreviewOfFileAtURLCompletionHandlerstatic interfaceQLPreviewingController.Block_preparePreviewOfSearchableItemWithIdentifierQueryStringCompletionHandler
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidpreparePreviewOfFileAtURLCompletionHandler(NSURL url, QLPreviewingController.Block_preparePreviewOfFileAtURLCompletionHandler handler)Use this method to prepare the content of the view controller with the given file URL.default voidpreparePreviewOfSearchableItemWithIdentifierQueryStringCompletionHandler(java.lang.String identifier, java.lang.String queryString, QLPreviewingController.Block_preparePreviewOfSearchableItemWithIdentifierQueryStringCompletionHandler handler)Use this method to prepare the content of the view controller with the data that the searchable item represents.
-
-
-
Method Detail
-
preparePreviewOfFileAtURLCompletionHandler
default void preparePreviewOfFileAtURLCompletionHandler(NSURL url, QLPreviewingController.Block_preparePreviewOfFileAtURLCompletionHandler handler)
Use this method to prepare the content of the view controller with the given file URL. This method will be called only once. It will be called in the main thread before presenting the view controller. Heavy work potentially blocking the main thread should be avoided in this method.- Parameters:
url- The URL of the file the user is about to preview.handler- The completion handler should be called whenever the view is ready to be displayed. A loading spinner will be shown until the handler is called. It can be called asynchronously after the method has returned.
-
preparePreviewOfSearchableItemWithIdentifierQueryStringCompletionHandler
default void preparePreviewOfSearchableItemWithIdentifierQueryStringCompletionHandler(java.lang.String identifier, java.lang.String queryString, QLPreviewingController.Block_preparePreviewOfSearchableItemWithIdentifierQueryStringCompletionHandler handler)Use this method to prepare the content of the view controller with the data that the searchable item represents. This method will be called only once. It will be called in the main thread before presenting the view controller. Heavy work potentially blocking the main thread should be avoided in this method.- Parameters:
identifier- The identifier of the CSSearchableItem the user interacted with in Spotlight.queryString- The query string the user entered in Spotlight before interacting with the CSSearchableItem.handler- The completion handler should be called whenever the view is ready to be displayed. A loading spinner will be shown until the handler is called. It can be called asynchronously after the method has returned.
-
-