Post not yet marked as solved
In iOS 10.x, app is showing PDF in QLPReviewController. In bottom tollbar share/action button is displayed. I am not able to hide/remove this button. Please help.
Post not yet marked as solved
It seems that on iOS 13 & 14 environment probes are notably too dark, and never reach an acceptable brightness that matches the surrounding environment.
Is there any way to get "reasonable" IBL lighting in QuickLook that is not like 50% gray all the time, without resorting to hacks such as using emissive colors/textures? Clearly there must be something wrong with the IBL estimation, as the same scene in Google SceneViewer is very bright and nice under the same circumstances.
The issue reproduces for example with the QuickLook gallery; the ceramics piece there is nearly 100% white as per the USD file but renders dull and gray next to a physical ceramics piece.
Video of the issue:
drive.google.com/file/d/14mVQFTNe6pO_4tYNIvpZa9eAS2YzoVPO/view?usp=sharing
More pictures:
drive.google.com/drive/folders/1ej6g-gpBAu53z2Zn08eQFNZAkTmDA_XJ?usp=sharing
Note that in those pictures, all spheres in that grid are purely white, with varying degrees of metallic and roughness being the only difference. My expectation would be that the diffuse ones would appear "white" and not dark grey; seems impossible to get a "realistic" picture.
Happens here as well:
https://developer.apple.com/augmented-reality/quick-look/models/cupandsaucer/cup_saucer_set.usdz
Post not yet marked as solved
Hi all,
I have an .obj model which I converted using Reality converter.
When trying to load it in safari quicklook, it pops up an error "Object requires a newer version of iOS"
I'm on an iPhone X with iOS 13.6.
Any thoughts?
Thanks
Post not yet marked as solved
Hello,
I've been having some issues getting WKWebView or QuickLook rendering a preview of files with iWork type extensions (.pages, .numbers, .key)
At first, I thought it was the contentType (or media type) not being set correctly, but I'm almost positive the correct one is application/vnd.apple.pages. I've seen older posts that reference the contentType as .pages.zip as iWork files at some point in time were directories, but it's my understanding that is no longer the case.
I've tried the following media types application/zip, application/pdf, application/vnd.apple.pages and the default application/octet-stream
see this doc for application/vnd.apple.pages confirmation.
iana.org/assignments/media-types/media-types.xhtml
I tried to just use QuickLook thinking this framework would solve all my problems. Well, the result is better in the respect that QuickLook doesn't default to showing the file encoding when a preview can't be shown. But the file preview is still missing.
See these basic implementations of WKWebView and QuickLook.
Note: Target iOS 13.6
All iWork Apps are updated
Assume files haven't been tampered with
Storyboard wkwebview
Pages_test.pages file is added into project and is in the correct target
No protocol methods implemented WKWebView
WKWebView
class ViewController: UIViewController, WKUIDelegate, WKNavigationDelegate {
@IBOutlet weak var webView:WKWebView!
override func viewDidLoad() {
		super.viewDidLoad()
		
		webView.uiDelegate = self
		webView.navigationDelegate = self
		
		let url = Bundle.main.url(forResource: "pages_test", withExtension: "pages")!
		
		var data:Data?
		do {
				try data = Data(contentsOf: url)
		} catch {
				fatalError("Error fetching data")
		}
		
		webView.load(data!, mimeType: "application/vnd.apple.pages", characterEncodingName: "", baseURL: url.deletingLastPathComponent())
}
QuickLook
class ViewController: UIViewController {
var previewView:QLPreviewController!
override func viewDidLoad() {
super.viewDidLoad()
setUpQuickLookPreview()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
showQuickLookPreview()
}
func setUpQuickLookPreview(){
previewView = QLPreviewController()
previewView.dataSource = self
previewView.delegate = self
previewView.currentPreviewItemIndex = 0
}
func showQuickLookPreview(){
present(previewView, animated: true, completion: nil)
}
}
extension ViewController: QLPreviewControllerDataSource, QLPreviewControllerDelegate {
func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
return 1
}
func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
let url = Bundle.main.url(forResource: "pages_test", withExtension: "pages")!
return url as QLPreviewItem
}
}
Post not yet marked as solved
Is it possible to write to an App Group's Container folder or UserDefaults from an iOS Thumbnail Extension or QuickLook Extension?
It doesn't work. It does work for a Widget extension.
I've added the App Group to the Entitlements of each extension.
For writing a file to App Group Container I get
Error Domain=NSCocoaErrorDomain Code=513 "Du hast nicht die Zugriffsrechte, um die Datei „quicklook 01 current.log“ im Ordner „DocumentInvestigation“ zu sichern." UserInfo={NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/<redacted: the container UUID>/DocumentInvestigation/quicklook 01 current.log, NSUnderlyingError=0x28090bb10 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
For setting App Group UserDefaults
[User Defaults] Couldn't write values for keys (
		example
) in CFPrefsPlistSource<0x2839cc700> (Domain: <redacted: the-group-identifier>, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No):
setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
The use case is, that we are investigating an issue and would like to log to a file which we then can have customers send us.
Post not yet marked as solved
I have a custom QLPreviewingController with a NSScrollView.
When I click with the mouse anywhere inside the ql preview view I can drag the window. This prevent to drag the scrollbar.
The problem exists only on big sur with custom quicklook appex.
Post not yet marked as solved
Hello, (sorry for long log attached within)
There has been concern (long story) that my secondary apple ID, phone was somehow linked or registered within an app developer or anything other then default and looking for clarification. This log is directly from the phone/apple ID and the log was generated with a credible source. The apple ID/phone should not be associated with anything and no APP dev account should be associated within the log.
Additionally my phone/apple ID that this log is associated with I am wondering if someone can tell me if there is anything to support or speculate that the phone is being shared or bundled in some fashion of any kind to share data, location, apps, or if there is anything such as coding of any kind that is anything other then what your standard phone would look like right out of the box with default settings. It's my suspicion that the apple id/phone log would support the issues that's been present of many issues that can be explained later.
Any help would be greatly [appreciated.](
Log of Apple ID/phone in question - https://developer.apple.com/forums/content/attachment/7c971c69-4a7c-43a4-b5e4-42e9e180d161
)
Post not yet marked as solved
Hey! Dose AR quick look support Mask Material? I have seen the the face tracking have face Mask out, which the face will create occlusion for the face. So the object like helmet wont look like just floating over the head. Now I wanted to take that mask material and apply to my other project, like world tracking and image tracking, is this possible?
thanks.
Post not yet marked as solved
I have an app on the Mac App Store (so sandboxed) that includes a QuickLook Preview Extension that targets Markdown files. It works just.
But I'm in the process of updating it so that it displays inline images as well as styled text. However, despite setting Downloads read-only access permission (and user-selected, though I know that shouldn't be required: no open/save dialogs here) in the extension's entitlements, Sandbox refuses too allow access to the test image: I always get a deny(1) file-read-data error in the log.
FWIW, the test file is referenced in the source Markdown as an absolute path.
I've tried different signings and no joy. I’ve tried placing the referenced image in various other locations. Also no joy.
Question is, is this just something QuickLook extensions cannot do from within the sandbox, or am I missing something? Is there anything extra I can do to debug this?
Post not yet marked as solved
Hello Guys, Have you tested requireManagedPasteboard key with your iOS beta, I have tested this successfully (On iOS 15 Beta 5 (iPhone 12)) but the still I am able to copy from Managed App quicklook (document preview) and paste to Unmanaged app.
Can you please test it out and confirm your experiences please.
Thanks
Siva
Post not yet marked as solved
https://itunes.apple.com/lookup?bundleId=com.xxxx.xxxx
while check this url in POST method then the version will shows updated version but when I check in GET method then it shows previous version.
Hi all, this is my first time trying to add an AR preview into an app (also my first time using the file system). I have been trying to implement a solution similar to that explained here https://developer.apple.com/forums/thread/126377 however one key difference is that my usdz model is not in my main bundle as it is generated and downloaded from an external source at run time. I was wondering if it is possible to display a file stored in the apps documents or cache directory and how it is done.
The file is downloaded and stored in the caches directory as follows:
class ModelFetcher: NSObject{
var modelUrl: URL?
func generateModel() {
guard let url = URL(string: "http://127.0.0.1:5000/model.usdz") else {return}
let urlSession = URLSession(configuration: .default, delegate: self, delegateQueue: OperationQueue())
var request = URLRequest(url: url)
request.httpMethod = "POST"
let downloadTask = urlSession.downloadTask(with: request)
downloadTask.resume()
}
}
extension ModelFetcher: URLSessionDownloadDelegate {
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) {
print("File Downloaded Location- ", location)
guard let url = downloadTask.originalRequest?.url else {
return
}
let docsPath = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
let destinationPath = docsPath.appendingPathComponent(url.lastPathComponent)
try? FileManager.default.removeItem(at: destinationPath)
do {
try FileManager.default.copyItem(at: location, to: destinationPath)
self.modelUrl = destinationPath
print("File moved to: \(modelUrl?.absoluteURL)")
} catch let error {
print("Copy Error: \(error.localizedDescription)")
}
}
}
and then the quick look preview looks like this:
import SwiftUI
import QuickLook
import ARKit
struct ARQuickLookView: UIViewControllerRepresentable {
var allowScaling: Bool = true
func makeCoordinator() -> ARQuickLookView.Coordinator {
Coordinator(self)
}
func makeUIViewController(context: Context) -> QLPreviewController {
let controller = QLPreviewController()
controller.dataSource = context.coordinator
return controller
}
func updateUIViewController(_ controller: QLPreviewController,
context: Context) {
// nothing to do here
}
class Coordinator: NSObject, QLPreviewControllerDataSource {
let parent: ARQuickLookView
let destinationPath = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0].appendingPathComponent("model.usdz")
private lazy var fileURL: URL = destinationPath
init(_ parent: ARQuickLookView) {
self.parent = parent
super.init()
}
func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
return 1
}
func previewController(
_ controller: QLPreviewController,
previewItemAt index: Int
) -> QLPreviewItem {
let fileURL = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0].appendingPathComponent("model.usdz")
print(fileURL)
let item = ARQuickLookPreviewItem(fileAt: fileURL)
print(item)
item.allowsContentScaling = parent.allowScaling
return item
}
}
}
struct ARQuickLookView_Previews: PreviewProvider {
static var previews: some View {
ARQuickLookView()
}
}
However, I get an error reading "Unhandled item type 13: contentType is: (null) #PreviewItem"
I know the file is actually located at this location as I have opened it in Finder. Any help would be much appreciated.
Thanks in advance,
Louis
Post not yet marked as solved
Will AR Quick Look support be provided via in-app browsers on iOS 15? The most recent update of iOS 15 doesn't provide this functionality. The user sees a greyed out AR button. The Object mode works as expected, however.
To replicate:
Send this link (https://www.apple.com/events) to the Gmail app, or message it to yourself in Slack or Discord
Open it
Tap on the Apple logo
Post not yet marked as solved
I'd like to add a QuickLook Preview Extension to my Mac app (AppKit), however I don't see a template for the extension in Xcode 13 under macOS (though there is a templete for iOS).
This seems to be a change as there was an extension template for Mac offered in Xcode 12.
Is this simply an oversight, or are Quick Look Preview Extensions no longer a thing on the Mac?
Post not yet marked as solved
Hi I am trying to display a USDZ model in my app using code similar to that described here:
https://developer.apple.com/documentation/arkit/previewing_a_model_with_ar_quick_look
however, after updating to iOS 15 and Xcode 13 the option to toggle between the base model view and the AR view is no longer there, the share button is also missing.
I am using view inside a navigation view in SwiftUI with code as follows.
import SwiftUI
struct ModelView: View {
var body: some View {
ARQuickLookView()
}
}
struct ModelView_Previews: PreviewProvider {
static var previews: some View {
ModelView()
}
}
import SwiftUI
import QuickLook
import ARKit
struct ARQuickLookView: UIViewControllerRepresentable {
var allowScaling: Bool = true
func makeCoordinator() -> ARQuickLookView.Coordinator {
Coordinator(self)
}
func makeUIViewController(context: Context) -> QLPreviewController {
let controller = QLPreviewController()
controller.dataSource = context.coordinator
return controller
}
func updateUIViewController(_ controller: QLPreviewController,
context: Context) {
// nothing to do here
}
class Coordinator: NSObject, QLPreviewControllerDataSource {
let parent: ARQuickLookView
init(_ parent: ARQuickLookView) {
self.parent = parent
super.init()
}
func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
return 1
}
func previewController(
_ controller: QLPreviewController,
previewItemAt index: Int) -> QLPreviewItem {
let url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent("model.usdz")
return url as QLPreviewItem
}
}
}
struct ARQuickLookView_Previews: PreviewProvider {
static var previews: some View {
ARQuickLookView()
}
}
Any info on why I don't have these options and how I could get them back would be appreciated.
Thanks
Louis
Post not yet marked as solved
Hi,
I'm trying to write a Quick Look extension for my iOS app.
However, I'm having issues initializing AVAudioEngine in my QLPreviewingController subclass from preparePreviewOfFile. The following error messages are printed to the console after attempting to initialize AVAudioEngine, and the Quick Look Extension crashes with EXC_BAD_ACCESS.
The same code works fine within the main iOS app. It also works on macOS inside a Catalyst app on the macOS Monterey RC when previewing a file in the Finder.
I've also filed feedback with feedback number FB9713048.
Thanks for taking a look at this.
Console output:
[audiocomp] AudioComponentPluginMgr.mm:545 reg server remote proxy error Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.audio.AudioComponentRegistrar was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.audio.AudioComponentRegistrar was invalidated: failed at lookup with error 159 - Sandbox restriction.}
[as] AudioSessionClientManager.cpp:475 Couldn't connect to com.apple.audio.AudioSession Error: 1100; AudioSession will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] AURemoteIO is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: AURemoteIO returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] AURemoteIO is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: AURemoteIO returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] AURemoteIO is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: AURemoteIO returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] GetProperty is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: GetProperty returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] SetProperty is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: SetProperty returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] Initialize is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: Initialize returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:1123 failed: 268435459 (enable 2, outf< 2 ch, 0 Hz, Float32, deinterleaved> inf< 2 ch, 0 Hz, Float32, deinterleaved>)
throwing -10878
throwing -10878
throwing -10878
throwing -10878
throwing -10878
throwing -10878
throwing -10878
throwing -10878
throwing -10878
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] SetProperty is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: SetProperty returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] Initialize is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: Initialize returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:1123 failed: 268435459 (enable 2, outf< 2 ch, 44100 Hz, Float32, deinterleaved> inf< 2 ch, 0 Hz, Float32, deinterleaved>)
[avae] AVAEInternal.h:109 [AVAudioEngineGraph.mm:1344:Initialize: (err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)): error 268435459
[avae] AVAudioEngine.mm:167 Engine@0x2830594d0: could not initialize, error = 268435459
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] SetProperty is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: SetProperty returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] Initialize is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: Initialize returned server mach error 0x10000003!
[aurioc] AURemoteIO.cpp:1123 failed: 268435459 (enable 2, outf< 2 ch, 44100 Hz, Float32, deinterleaved> inf< 2 ch, 0 Hz, Float32, deinterleaved>)
[avae] AVAEInternal.h:109 [AVAudioEngineGraph.mm:1344:Initialize: (err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)): error 268435459
[avae] AVAudioEngineGraph.mm:4631 Can't retrieve source node to play sequence because there is no output node!
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[aurioc] AURemoteIO.cpp:148 Couldn't connect to com.apple.audio.AURemoteIOServer; AURemoteIO will not be usable
[default] GetProperty is passing a serverPID of 0 to CheckRPCError!
[default] CheckRPCError: GetProperty returned server mach error 0x10000003!
(lldb)
Post not yet marked as solved
AR Quick View's AR Quick View button cannot be pressed on some iOS
devices.
As for the iPhone 12 Pro, the AR Quick View button cannot be pressed on
iOS 15 when reading from the standard iOS QR code reader, but the AR
Quick View button can be pressed on the iPhone 12 Pro with iOS 14.
On other devices, you can press the AR Quick View button when launching
from Safari, but you cannot press the AR Quick View button when
accessing from the standard QR code reader. Also, on some iOS devices,
the AR Quick View button cannot be pressed.
The problem seems to be occurring outside of the https://konabeer.jp/beach-diorama-ar/ as well.
Is there any way to avoid this AR Quick View button not being able to be pressed?
It would be very helpful if I could get more information than just the solution to this problem.
iPhone7(iOS13):OK
iPhoneX(iOS15):QR Code Reader:NG
iPhone11(iOS14):OK
iPhone12Pro(iOS14):OK
iPhone12Pro(iOS15):QR Code Reader:NG
iPhone12(iOS15.1):QR Code Reader:NG
iPad Air(iOS15):QR Code Reader:NG
iPhoneSE(iOS15):QR Code Reader:NG
As a result of our own verification, the AR Quick Look button is
deactivated on iOS 15 and when the QR code is imported from the Control
Center.
If you know of any known bugs or workarounds, or if there are any informative sites that have information on this issue, I would appreciate it.
Post not yet marked as solved
Hello, I am trying to use app groups to share preferences between an app and its QuickLook extension (both sandboxed), but I can't understand why it's not working.
For testing, I created an empty macOS app project and added a QuickLook Extension, then on both the targets' entitlement files I added the app group domain in the form "teamid.test". Last but not least, in the Info.plist file of the QL extension i added some UTIs to have the QL extension called when previewing.
In the QL extension's PreviewViewController.swift file I try to save a value like this:
func preparePreviewOfFile(at url: URL, completionHandler handler: @escaping (Error?) -> Void) {
let defaults=UserDefaults(suiteName: "teamid.***")
defaults?.set(1, forKey: "test")
handler(nil)
}
If I try to run the app and preview a file though, I get this message in the Console:
Couldn't write values for keys ( test ) in CFPrefsPlistSource<0x7fb63681cce0> (Domain: teamid.***, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: Yes): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
And the value is not saved. The only way to make this work is to add a temporary exception in the extension target, like this:
<array>
<string>/Library/Group Containers/teamid.***/</string>
</array>
</plist>
What bugs me is that if I try to save a value from the app instead, it works.
Are app groups not supported for QuickLook extensions?
Thank you,
Michele
Post not yet marked as solved
Hi together,
I am developing a document viewer for a specific API. I download the relevant files to a custom directory and open them using a QLPreviewController in SwiftUI. I built this with a UIViewControllerRepresentable.
Everything is working fine except the saving of modified files using the pencil markup in the preview.
Here is the error:
https://pastebin.com/TRnfduE5
This is how my controller looks like:
struct PreviewController: UIViewControllerRepresentable {
let url: URL
@Binding var isPresented: Bool
func makeUIViewController(context: Context) -> UINavigationController {
let controller = QLPreviewController()
controller.dataSource = context.coordinator
controller.navigationItem.leftBarButtonItem = UIBarButtonItem(
barButtonSystemItem: .done, target: context.coordinator,
action: #selector(context.coordinator.dismiss)
)
let navigationController = UINavigationController(rootViewController: controller)
return navigationController
}
func makeCoordinator() -> Coordinator {
return Coordinator(parent: self)
}
func updateUIViewController(_ uiViewController: UINavigationController, context: Context) {
let controller = QLPreviewController()
controller.dataSource = context.coordinator
}
class Coordinator: QLPreviewControllerDataSource {
let parent: PreviewController
init(parent: PreviewController) {
self.parent = parent
}
@objc func dismiss() {
parent.isPresented = false
}
func numberOfPreviewItems(
in controller: QLPreviewController
) -> Int {
return 1
}
func previewController(
_ controller: QLPreviewController, previewItemAt index: Int
) -> QLPreviewItem {
return parent.url as QLPreviewItem
}
func previewController(_ controller: QLPreviewController, editingModeFor previewItem: QLPreviewItem
) -> QLPreviewItemEditingMode {
.createCopy
}
func previewController(_: QLPreviewController, didUpdateContentsOf: QLPreviewItem){
print("Updated.")
}
func previewController(_: QLPreviewController, didSaveEditedCopyOf: QLPreviewItem, at: URL) {
print("Saved: " + at.path)
}
}
}
Does anyone know, what the problem is here?
And I made another experience: as you see there, I'm currently only logging the output / actions - and there isn't anything being logged, if I made just one edit. It only throws the error above after the 1st edit - so if I edit sth again and tap done or the pencil icon again...
Is this ok so?
Thanks for any help or advise!
Post not yet marked as solved
I want to debug my QuickLook extension for macOS. I read somewhere online that when running it in Xcode, I have to select Quick Look Simulator, but I have no idea what to do after that, and I couldn't find any official documentation.