Example: /iOS/QLPreviewController test

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/iOS/QLPreviewController test


You find this example project in your Plugins Download as a Xojo project file within the examples folder: /iOS/QLPreviewController test

This example is the version from Mon, 11th Jun 2023.

Project "QLPreviewController test.xojo_binary_project"
Class App Inherits MobileApplication
End Class
Class Screen1 Inherits MobileScreen
Control ShowButton Inherits MobileButton
ControlInstance ShowButton Inherits MobileButton
Constraint Constraint 1
Constraint Constraint 2
Constraint Constraint 3
Constraint Constraint 4
EventHandler Sub Pressed() // we show the controller here with editing disabled panel = New QLPreviewControllerMBS panel.AddItem PDFFile panel.Present End EventHandler
End Control
Control EditButton Inherits MobileButton
ControlInstance EditButton Inherits MobileButton
Constraint Constraint 1
Constraint Constraint 2
Constraint Constraint 3
Constraint Constraint 4
EventHandler Sub Pressed() // we show the controller here with editing enabled Dim panel As New QLPreviewController panel.AddItem PDFFile panel.editingAllowed = true panel.Present Self.Panel = panel // keep reference until it is closed End EventHandler
End Control
EventHandler Sub Opening() // we load a sample PDF, so we can show you something. PDFFile = SpecialFolder.Documents.Child("Installation.pdf") Download = New URLConnection AddHandler Download.FileReceived, WeakAddressOf FileReceived Download.Send "GET", "https://www.monkeybreadsoftware.de/xojo/download/plugin/Installation.pdf", PDFFile End EventHandler
Sub FileReceived(Connection As URLConnection, URL As String, HTTPStatus As Integer, file As FolderItem) If HTTPStatus <> 200 Then MessageBox "Download of PDF failed!" Break return End If ShowButton.Enabled = True EditButton.Enabled = True End Sub
Property Download As URLConnection
Property PDFFile As FolderItem
Property Panel As QLPreviewControllerMBS
End Class
Class LaunchScreen Inherits iosView
End Class
Class QLPreviewController Inherits QLPreviewControllerMBS
EventHandler Sub DidDismiss() System.DebugLog CurrentMethodName End EventHandler
EventHandler Sub WillDismiss() System.DebugLog CurrentMethodName End EventHandler
EventHandler Sub didSaveEditedCopyOfPreviewItem(Item as FolderItem, modifiedContentsFile as FolderItem) System.DebugLog CurrentMethodName // we copy it over the old file, but you may do more item.Remove modifiedContentsFile.CopyTo Item End EventHandler
EventHandler Sub didUpdateContentsOfPreviewItem(Item as FolderItem) System.DebugLog CurrentMethodName End EventHandler
EventHandler Function editingModeForPreviewItem(Item as FolderItem) As Integer System.DebugLog CurrentMethodName If editingAllowed Then Return EditingModeCreateCopy Else Return EditingModeDisabled End If End EventHandler
Property editingAllowed As Boolean
End Class
End Project

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


💬 Ask a question or report a problem