Platforms to show: All Mac Windows Linux Cross-Platform

Back to QLPreviewControllerMBS class.

QLPreviewControllerMBS.DidDismiss

Type Topic Plugin Version macOS Windows Linux iOS Targets
event QuickLook MBS iOS Plugin 23.3 ❌ No ❌ No ❌ No ✅ Yes
Tells you that the preview was closed.

QLPreviewControllerMBS.didSaveEditedCopyOfPreviewItem(Item as FolderItem, modifiedContentsFile as FolderItem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event QuickLook MBS iOS Plugin 23.3 ❌ No ❌ No ❌ No ✅ Yes
Tells you that the preview item’s edited content was successfully saved to a copy at the given URL.

The platform invokes this callback with an edited copy of the preview item at modifiedContentsFile. It invokes the callback in the following scenarios:

  • The editing mode of the previewItem is EditingModeCreateCopy.
  • The editing mode of the previewItem is EditingModeUpdateContents and the system can’t overwrite its previewItemURL. In this case, modifiedContentsURL points to a temporary file on disk containing the edited copy.
  • The editing mode of the preview item is EditingModeUpdateContents and its content type doesn’t match the content type of the edited version. This mismatch means that the file type of the file at modifiedContentsURL may be different from the file type of the preview item.

The platform may invoke the callback multiple times consecutively with the successive edited versions of the preview item. It typically invokes the callback once for each time the user saves their edits.

Some examples using this event:

QLPreviewControllerMBS.didUpdateContentsOfPreviewItem(Item as FolderItem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event QuickLook MBS iOS Plugin 23.3 ❌ No ❌ No ❌ No ✅ Yes
Tells you that the content of a preview was updated successfully.

The platform invokes this callback after the preview controller successfully overwrites the file at the previewItem location with an updated file.

The platform may invoke the callback multiple times consecutively with the successive edited versions of the preview item. It typically invokes the callback once for each time the user saves their edits.

Some examples using this event:

QLPreviewControllerMBS.editingModeForPreviewItem(Item as FolderItem) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event QuickLook MBS iOS Plugin 23.3 ❌ No ❌ No ❌ No ✅ Yes
Returns a value that indicates how the preview controller handles edits to the content of the previewed file.

Return a value that indicates whether the previewed content is editable and how Quick Look saves the edits. If you return EditingModeUpdateContents or EditingModeCreateCopy to allow edits to a preview, make sure to implement the appropriate callbacks.

The platform invokes this callback when the preview controller loads its data. The system calls it for each preview item that it passes to the data source of the preview controller.
By default, a preview controller doesn’t allow edits to a preview. However, you can implement this method to allow the user to edit the previewed document, and specify the behavior for saving changes. The supported set of edits may change over time, but currently includes adding markup to images or PDFs, as well as simple edits to video files.
If you want to update the underlying file in place, return EditingModeUpdateContents, and implement both the didUpdateContentsOfPreviewItem and didSaveEditedCopyOfPreviewItem delegate methods. The Quick Look feature calls didUpdateContentsOfPreviewItem first and updates the preview item’s content. If it can’t update the item directly, it invokes didSaveEditedCopyOfPreviewItem and creates a copy of the preview item’s content that contains the edits.
If you prefer to always save edits to a copy of the preview item’s content, return EditingModeCreateCopy and implement didSaveEditedCopyOfPreviewItem.

Some examples using this event:

QLPreviewControllerMBS.shouldOpenURL(URL as String, Item as FolderItem) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event QuickLook MBS iOS Plugin 23.3 ❌ No ❌ No ❌ No ✅ Yes
Whether the preview controller should open a URL.

The system invokes this method when the user taps a URL link in a preview. If you return true, the Quick Look preview controller invokes the openURL method on the UIApplication object, sending it the value of the url parameter. If you return false, the system doesn’t invoke the openURL method and you can do something yourself.

If you don’t implement this method, it defaults to returning true.

QLPreviewControllerMBS.WillDismiss

Type Topic Plugin Version macOS Windows Linux iOS Targets
event QuickLook MBS iOS Plugin 23.3 ❌ No ❌ No ❌ No ✅ Yes
Tells you that the preview is about to close.

The items on this page are in the following plugins: MBS iOS Plugin.


The biggest plugin in space...