QuickLook

RSS for tag

Create previews of files to use inside your app or perform simple edits on previews using QuickLook.

Posts under QuickLook tag

154 Posts

Post

Replies

Boosts

Views

Activity

Exporting scripts to a USDZ file in Reality Composer PRO.
Hello. I've started exploring the new features in Reality Composer PRO and noticed that Composer now supports adding custom scripts as components to any objects in the scene. I'm curious about the following: will these scripts work if I export such a scene to a USDZ file and try to open it using Apple Quick Look? For instance, I want to add a 3D button and a cube model. When I press the button (touch it), I want to change the material or material color to another one using a script component. Is such functionality possible?
0
0
789
Oct ’23
.md support broken on MacOS
After I uninstalled Xcode and its CLI tools from my MacBook (Intel based, Ventura 13.5.2) the operating system seems to have forgotten how to handle Markdown files. I can still open them using VSCode or TextEdit but when I preview them using space they just show the file icon. My major issue with this is that I am using shortcuts to interact with them. They also stopped working on my MacBook exclusively. On both iPad and iPhone they still work. I appreciate any ideas on how to resolve this issue.
1
0
1.1k
Sep ’23
AR Kit Anchor
Hi, I’ve implemented an ARKit app that display an usdz object in the real world. In this scenario, the placement is via image recognition (Reality Composer Scene) Obviously when I don’t see the image (QR marker), the app could not detect the anchor and it will not place the object in the real world. Is it possibile to recognize an image (QR marker) and after placing the object on it, leave the object there ? So basically detect the marker place the object leave the object there, not depending on the image (marker) recognition Thanks
0
1
786
Sep ’23
About metersPerUnit in USDZ
Hi, I watched the WWDC23 session video, "Create 3D models for Quick Look spatial experiences." https://developer.apple.com/videos/play/wwdc2023/10274/ In the video, I understood that the scale of models displayed using visionOS's AR Quick Look is determined by referencing the "metersPerUnit" value in USDZ files. I tried to find tools to set the "metersPerUnit" in 3D software or tools to view the "metersPerUnit" in USDZ files, but I couldn't find any. I believe adjusting the "metersPerUnit" in USDZ is crucial to achieve real-world scale when displaying models through visionOS's AR Quick Look. If anyone knows of apps or tools that can reference USDZ's "metersPerUnit" or 3D editor apps or tools that allow exporting with the "metersPerUnit" value properly reflected, I would greatly appreciate the information. Best regards. Sadao Tokuyama https://twitter.com/tokufxug https://www.linkedin.com/in/sadao-tokuyama/
0
0
899
Jul ’23
QLPreviewController is not saving file for Large Size PDF
I am using QLPreviewController with SwiftUI using UIViewControllerRepresentable. If I try to delete or insert pages of large size PDF, QLPreviewController is not calling delegate methods (didUpdateContentsOf, didSaveEditedCopyOf). struct QuickLookController: UIViewControllerRepresentable { @Environment(\.dismiss) var dismiss weak var delegate: QLPreviewControllerDelegate? weak var dataSource: QLPreviewControllerDataSource? func makeUIViewController(context: Context) -> UINavigationController { let controller = context.coordinator.controller controller.delegate = delegate controller.dataSource = dataSource controller.navigationItem.rightBarButtonItem = context.coordinator.dismissButton return UINavigationController(rootViewController: controller) } func updateUIViewController(_ viewController: UINavigationController, context: UIViewControllerRepresentableContext<QuickLookController>) { } func makeCoordinator() -> Self.Coordinator { .init(parent: self) } @MainActor class Coordinator: NSObject { var parent: QuickLookController init(parent: QuickLookController) { self.parent = parent } lazy var controller: QLPreviewController = { let controller = QLPreviewController() return controller }() lazy var dismissButton: UIBarButtonItem = { let button = UIBarButtonItem( title: NSLocalizedString("Done", comment: ""), style: .plain, target: self, action: #selector(rightButtonTapped(_:)) ) button.tag = 2 return button }() @objc func rightButtonTapped(_ sender: Any) { controller.dismiss(animated: true) } } } // MARK: QuickLook extension ViewerModel: QLPreviewControllerDataSource, QLPreviewControllerDelegate { public func numberOfPreviewItems(in controller: QLPreviewController) -> Int { 1 } public func previewController( _ controller: QLPreviewController, previewItemAt index: Int ) -> QLPreviewItem { let title = self.document .documentURL? .lastPathComponent ?? "" let url = PDFManager .directory .appendingPathComponent(title) as NSURL return url as QLPreviewItem } public func previewControllerDidDismiss(_ controller: QLPreviewController) { } public func previewControllerWillDismiss(_ controller: QLPreviewController) { } ✔️ It's same even if I set it to updateContents public func previewController(_ controller: QLPreviewController, editingModeFor previewItem: QLPreviewItem) -> QLPreviewItemEditingMode { .createCopy } ✔️ Not called with Large Size PDF public func previewController(_ controller: QLPreviewController, didUpdateContentsOf previewItem: QLPreviewItem) { } ✔️ Not called with Large Size PDF public func previewController(_ controller: QLPreviewController, didSaveEditedCopyOf previewItem: QLPreviewItem, at modifiedContentsURL: URL) { } }
0
0
973
Jul ’23
Do items opened in "Windowed Quick Look" on visionOS stay open until the user closes them?
I’ve poured over the session “Discover Quick Look for spatial computing” and I was really impressed about “Windowed Quick Look” and how items can be opened in their own Volume and stay open even if the app/website they were opened from was closed. I had an additional question–how long do items in “Windowed Quick Look” remain in the Shared Space after the app or web page they were opened from is closed? I’m imaging something like a how-to document or diagram that users could be consulting visually but not interacting with, will visionOS purge it from memory at some point or will it persist indefinitely until the user manually closes them? Same example if I was using a how-to document or diagram to help me work or learn alongside the app/site I was working or learning in, it would be more convenient if it was still open so I could continue right where I left off.

Therefore, if a user were to take off the Vision Pro for the evening and then put it back on in the morning, would the item they opened in Windowed Quick Look persist alongside the other apps/windows/volumes they had open and were working with in the Shared Space?
0
0
826
Jun ’23
Banners embedded in USDZ files?
Just getting familiar with XCode. Using Reality Composer a lot now. Ready to try coding along with with Reality Composer. Saw this demo (see link below), but I don't want to use a web server to retrieve banner information, I would prefer to embed this information directly into the USDZ file to be read with AR Quick Look. **Two questions: ** How can you get a banner like this when you open an USDZ file and edit the banner information directly (within the file itself) without using a URL? In place of the call to action button (for Apple Pay) in the demo below, I'd like to use that button to either call a phone number, send a text, or go to a web URL. Link to Apple's example with Apple Pay (see custom examples section, like for the kids' slide example on that page). https://developer.apple.com/augmented-reality/quick-look/ Scraps are welcome, hungry to learn.
0
0
995
Jun ’23
QuickLook on macOS: various questions
I'm trying to create a custom Quick Look preview on macOS. I've found the Quick Look Preview Extension target, which is brilliant, and does most of the 'heavy' lifting, but I've run into a few problems. I'm implementing a preview for MIDI files (which has been missing since 2009...) using AVMIDIPlayer. The player keeps playing when the file is no longer selected! What's the mechanism for fixing that? Some sort of check that the view exists..? I notice that the OS preview for audio files has a different interface for the Finder's preview column and for the QuickLook 'pop-up' window. Again, I can't see how you define different views for those two environments. Is there any documentation that's specifically "Mac"? I can only find iOS stuff. (Same for third-party tutorials.)
2
1
2.1k
Jun ’23
QuickLook preview for a system supported file extension
I'm working on a QuickLook extension for the file extension snd. This extension was used by multiple companies in the 90s most notably by Sun. https://en.wikipedia.org/wiki/Au_file_format However it was also used by companies manufacturing samplers and synthesiser. I'd like to preview files from the latter, however I was not able to make my extension run when these files are previewed. To verify my extension works I added an exported UTI with the file extension dmf which is completely owned by my app and preview and opening the files work as expected. However for the snd extension the system always uses the same preview (I assume QuickTime) and it doesn't matter if I associate my app with all files using the file extension. I'm assuming since it's impossible to tell just from the filename what kind of file this is the system just simply assumes it's a Sun file format and uses one of the first part previews, QuickTime or maybe Audio.qlgenerator. Is there any way I could override this behaviour just for this one file extension? (As a side note I guess I could try the older QLGenerator route as well, but I recall not being able to play back audio files with those APIs no matter what I tried) Any help would be welcome.
0
0
903
Jun ’23
Draco compression in USDZ for Quick Look
Hi, I looked through whole internet searching for some way to compress USDZ files for AR (Quick Look). I see there is some old blog post about Draco compression for USD - https://opensource.googleblog.com/2019/11/google-and-pixar-add-draco-compression.html . Does anyone know if Quick Look supports USDZ files with Draco compression? I haven't found any mention of it in the official documentations :/ Or maybe there is some other way?
1
1
1.7k
Apr ’23
SwiftUI: quickLookPreview - called while the panel has no controller?
Hello all, I am trying to use quickLookPreview in SwiftUI (macOS) to view a file using quicklook. The following sample code is actually very simple: import SwiftUI import QuickLook struct ContentView: View {     @State var qlURL: URL?     var body: some View {         Button("Show QuickLook") {             qlURL = URL.init(fileURLWithPath: "path to a file")         }         .quickLookPreview($qlURL)     } } At first glance, everything looks great and the specified file is displayed via quicklook. However, I get numerous error messages in the log: 2023-03-10 14:46:58.258051+0100 SwiftUI-Test1[998:5878590] [General] -[QLPreviewPanel setDelegate:] called while the panel has no controller - Fix this or this will raise soon. See comments in QLPreviewPanel.h for -acceptsPreviewPanelControl:/-beginPreviewPanelControl:/-endPreviewPanelControl:. 2023-03-10 14:46:58.258228+0100 SwiftUI-Test1[998:5878590] [General] -[QLPreviewPanel setDataSource:] called while the panel has no controller - Fix this or this will raise soon. See comments in QLPreviewPanel.h for -acceptsPreviewPanelControl:/-beginPreviewPanelControl:/-endPreviewPanelControl:. 2023-03-10 14:46:58.261948+0100 SwiftUI-Test1[998:5878590] [General] -[QLPreviewPanel reloadData] called while the panel has no controller - Fix this or this will raise soon. See comments in QLPreviewPanel.h for -acceptsPreviewPanelControl:/-beginPreviewPanelControl:/-endPreviewPanelControl:. I'm admittedly a bit lost - how are these messages to be understood and how can they be fixed. Xcode 14.2, macOS 13.2, Target: macOS Thanks! Gerald
2
1
1.4k
Apr ’23
Crash when printing a document from UIActivityViewController or QLPreviewController on iOS 16
Seems like the printing doesn't appear to be worked correctly on iOS 16. We've been getting a lot of crash reports related to printing since iOS 16 was released, for instance print_crash_report.txt Unfortunately, we are unable to reproduce those crashes. This article says that SEGV_MAPERR crash is due to an invalid memory fetch. For this reason, we decided to debug our app with the Address Sanitizer tool enabled in Xcode. As a result, we found out that almost every time the app accesses a freed heap region when the print UI is presented. address_sanitizer_report.txt The were able to reproduce 2 cases in a separated project: Printing a docx file from QLPreviewController Printing the same file from UIActivityViewController passing WKWebView.viewPrintFormatter as an activity item. In order to get the error, once you get to the print UI start scrolling the document preview. See the sample code bellow: import UIKit import WebKit import QuickLook final class PrintCrashViewController: UIViewController { private let webView = WKWebView() /* 27 page document from the app bundle */ private lazy var docFileURL = URL(fileURLWithPath: Bundle.main.path(forResource: "description", ofType: "docx")!) override func loadView() { view = webView } override func viewDidLoad() { super.viewDidLoad() navigationItem.rightBarButtonItems = [ UIBarButtonItem(title: "QL", style: .plain, target: self, action: #selector(openQLPreview)), UIBarButtonItem(title: "Share", style: .plain, target: self, action: #selector(openActivityVC)) ] webView.loadFileURL(docFileURL, allowingReadAccessTo: docFileURL) } @objc private func openActivityVC() { let items: [Any] = [docFileURL, webView.viewPrintFormatter()] let activityVC = UIActivityViewController(activityItems: items, applicationActivities: nil) present(activityVC, animated: true) } @objc private func openQLPreview() { let qlPreviewVC = QLPreviewController() qlPreviewVC.dataSource = self present(qlPreviewVC, animated: true) } } extension PrintCrashViewController: QLPreviewControllerDataSource { func numberOfPreviewItems(in controller: QLPreviewController) -> Int { 1 } func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { docFileURL as NSURL } } Both approaches have been in our app for years.
1
2
1.5k
Apr ’23
ARKit ARQuickLookPreviewItem only provides API for setting limited subset of potential parameters
ARQuickLookPreviewItem only provides API for specifying values for allowsContentScaling and canonicalWebPageURL parameters. (https://developer.apple.com/documentation/arkit/arquicklookpreviewitem) However, there are many more parameters that can be specified from a link originating from Safari. EG: applePayButtonType, callToAction, checkoutTitle, checkoutSubtitle, price, custom, customHeight (https://developer.apple.com/documentation/arkit/adding_an_apple_pay_button_or_a_custom_action_in_ar_quick_look) It would be great to get support for all these parameters in the ARQuickLookPreviewItem API so that apps can integrate richer features of ARQL.
0
0
613
Apr ’23
Allowing QuickLook preview to work for all files with a specific extension.
Hi, I have create a Mac app that allows viewing of ".fit" files a file format use to record exercise activities and routes (among other things). I have created a QuickLook Extension to preview these in the finder and this is working fine in most cases if I add file access for this extension in system settings There are serval cases where this does not work, I'm guessing because of the sandbox? e.g. fit files in iCloud Drive just show default QL view not my custom one. Is there a way to allow the QL extension to view a "fit" no matter where it might be? Thanks Ants
3
0
1.2k
Feb ’23
Exporting scripts to a USDZ file in Reality Composer PRO.
Hello. I've started exploring the new features in Reality Composer PRO and noticed that Composer now supports adding custom scripts as components to any objects in the scene. I'm curious about the following: will these scripts work if I export such a scene to a USDZ file and try to open it using Apple Quick Look? For instance, I want to add a 3D button and a cube model. When I press the button (touch it), I want to change the material or material color to another one using a script component. Is such functionality possible?
Replies
0
Boosts
0
Views
789
Activity
Oct ’23
Obj converted with Reality converter fails to show on Quicklook
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
Replies
8
Boosts
0
Views
4.7k
Activity
Oct ’23
QuickLook broken
QuickLook broken on iOS17, does not open reality file.
Replies
2
Boosts
0
Views
1k
Activity
Oct ’23
Editing in duplicate page is affecting original Page iOS17
I am showing PDF file in QLPreview Controller, in iOS17, after copy and paste the page of pdf and edit the original page using Pencil kit, will affect the duplicate page also. How to restrict? Thanks to all
Replies
0
Boosts
0
Views
650
Activity
Oct ’23
.md support broken on MacOS
After I uninstalled Xcode and its CLI tools from my MacBook (Intel based, Ventura 13.5.2) the operating system seems to have forgotten how to handle Markdown files. I can still open them using VSCode or TextEdit but when I preview them using space they just show the file icon. My major issue with this is that I am using shortcuts to interact with them. They also stopped working on my MacBook exclusively. On both iPad and iPhone they still work. I appreciate any ideas on how to resolve this issue.
Replies
1
Boosts
0
Views
1.1k
Activity
Sep ’23
AR Kit Anchor
Hi, I’ve implemented an ARKit app that display an usdz object in the real world. In this scenario, the placement is via image recognition (Reality Composer Scene) Obviously when I don’t see the image (QR marker), the app could not detect the anchor and it will not place the object in the real world. Is it possibile to recognize an image (QR marker) and after placing the object on it, leave the object there ? So basically detect the marker place the object leave the object there, not depending on the image (marker) recognition Thanks
Replies
0
Boosts
1
Views
786
Activity
Sep ’23
About metersPerUnit in USDZ
Hi, I watched the WWDC23 session video, "Create 3D models for Quick Look spatial experiences." https://developer.apple.com/videos/play/wwdc2023/10274/ In the video, I understood that the scale of models displayed using visionOS's AR Quick Look is determined by referencing the "metersPerUnit" value in USDZ files. I tried to find tools to set the "metersPerUnit" in 3D software or tools to view the "metersPerUnit" in USDZ files, but I couldn't find any. I believe adjusting the "metersPerUnit" in USDZ is crucial to achieve real-world scale when displaying models through visionOS's AR Quick Look. If anyone knows of apps or tools that can reference USDZ's "metersPerUnit" or 3D editor apps or tools that allow exporting with the "metersPerUnit" value properly reflected, I would greatly appreciate the information. Best regards. Sadao Tokuyama https://twitter.com/tokufxug https://www.linkedin.com/in/sadao-tokuyama/
Replies
0
Boosts
0
Views
899
Activity
Jul ’23
QLPreviewController is not saving file for Large Size PDF
I am using QLPreviewController with SwiftUI using UIViewControllerRepresentable. If I try to delete or insert pages of large size PDF, QLPreviewController is not calling delegate methods (didUpdateContentsOf, didSaveEditedCopyOf). struct QuickLookController: UIViewControllerRepresentable { @Environment(\.dismiss) var dismiss weak var delegate: QLPreviewControllerDelegate? weak var dataSource: QLPreviewControllerDataSource? func makeUIViewController(context: Context) -> UINavigationController { let controller = context.coordinator.controller controller.delegate = delegate controller.dataSource = dataSource controller.navigationItem.rightBarButtonItem = context.coordinator.dismissButton return UINavigationController(rootViewController: controller) } func updateUIViewController(_ viewController: UINavigationController, context: UIViewControllerRepresentableContext<QuickLookController>) { } func makeCoordinator() -> Self.Coordinator { .init(parent: self) } @MainActor class Coordinator: NSObject { var parent: QuickLookController init(parent: QuickLookController) { self.parent = parent } lazy var controller: QLPreviewController = { let controller = QLPreviewController() return controller }() lazy var dismissButton: UIBarButtonItem = { let button = UIBarButtonItem( title: NSLocalizedString("Done", comment: ""), style: .plain, target: self, action: #selector(rightButtonTapped(_:)) ) button.tag = 2 return button }() @objc func rightButtonTapped(_ sender: Any) { controller.dismiss(animated: true) } } } // MARK: QuickLook extension ViewerModel: QLPreviewControllerDataSource, QLPreviewControllerDelegate { public func numberOfPreviewItems(in controller: QLPreviewController) -> Int { 1 } public func previewController( _ controller: QLPreviewController, previewItemAt index: Int ) -> QLPreviewItem { let title = self.document .documentURL? .lastPathComponent ?? "" let url = PDFManager .directory .appendingPathComponent(title) as NSURL return url as QLPreviewItem } public func previewControllerDidDismiss(_ controller: QLPreviewController) { } public func previewControllerWillDismiss(_ controller: QLPreviewController) { } ✔️ It's same even if I set it to updateContents public func previewController(_ controller: QLPreviewController, editingModeFor previewItem: QLPreviewItem) -> QLPreviewItemEditingMode { .createCopy } ✔️ Not called with Large Size PDF public func previewController(_ controller: QLPreviewController, didUpdateContentsOf previewItem: QLPreviewItem) { } ✔️ Not called with Large Size PDF public func previewController(_ controller: QLPreviewController, didSaveEditedCopyOf previewItem: QLPreviewItem, at modifiedContentsURL: URL) { } }
Replies
0
Boosts
0
Views
973
Activity
Jul ’23
Want the code for this project
I would like to see the entire code for the tutorial used in this video
Replies
0
Boosts
0
Views
906
Activity
Jun ’23
Do items opened in "Windowed Quick Look" on visionOS stay open until the user closes them?
I’ve poured over the session “Discover Quick Look for spatial computing” and I was really impressed about “Windowed Quick Look” and how items can be opened in their own Volume and stay open even if the app/website they were opened from was closed. I had an additional question–how long do items in “Windowed Quick Look” remain in the Shared Space after the app or web page they were opened from is closed? I’m imaging something like a how-to document or diagram that users could be consulting visually but not interacting with, will visionOS purge it from memory at some point or will it persist indefinitely until the user manually closes them? Same example if I was using a how-to document or diagram to help me work or learn alongside the app/site I was working or learning in, it would be more convenient if it was still open so I could continue right where I left off.

Therefore, if a user were to take off the Vision Pro for the evening and then put it back on in the morning, would the item they opened in Windowed Quick Look persist alongside the other apps/windows/volumes they had open and were working with in the Shared Space?
Replies
0
Boosts
0
Views
826
Activity
Jun ’23
Banners embedded in USDZ files?
Just getting familiar with XCode. Using Reality Composer a lot now. Ready to try coding along with with Reality Composer. Saw this demo (see link below), but I don't want to use a web server to retrieve banner information, I would prefer to embed this information directly into the USDZ file to be read with AR Quick Look. **Two questions: ** How can you get a banner like this when you open an USDZ file and edit the banner information directly (within the file itself) without using a URL? In place of the call to action button (for Apple Pay) in the demo below, I'd like to use that button to either call a phone number, send a text, or go to a web URL. Link to Apple's example with Apple Pay (see custom examples section, like for the kids' slide example on that page). https://developer.apple.com/augmented-reality/quick-look/ Scraps are welcome, hungry to learn.
Replies
0
Boosts
0
Views
995
Activity
Jun ’23
Visualisation Revisited playground
I am really suffering about this exercise, but don't know what I am doing wrong( attached screenshots bellow:
Replies
3
Boosts
1
Views
1.4k
Activity
Jun ’23
Are Quick Look Extensions supported in visionOS?
My iOS app has a Quick Look extension. Will this Quick Look extension be available in visionOS when run as an iPad app in the Shared Space and/or if I rebuild using the visionOS SDK?
Replies
1
Boosts
1
Views
1k
Activity
Jun ’23
QuickLook on macOS: various questions
I'm trying to create a custom Quick Look preview on macOS. I've found the Quick Look Preview Extension target, which is brilliant, and does most of the 'heavy' lifting, but I've run into a few problems. I'm implementing a preview for MIDI files (which has been missing since 2009...) using AVMIDIPlayer. The player keeps playing when the file is no longer selected! What's the mechanism for fixing that? Some sort of check that the view exists..? I notice that the OS preview for audio files has a different interface for the Finder's preview column and for the QuickLook 'pop-up' window. Again, I can't see how you define different views for those two environments. Is there any documentation that's specifically "Mac"? I can only find iOS stuff. (Same for third-party tutorials.)
Replies
2
Boosts
1
Views
2.1k
Activity
Jun ’23
QuickLook preview for a system supported file extension
I'm working on a QuickLook extension for the file extension snd. This extension was used by multiple companies in the 90s most notably by Sun. https://en.wikipedia.org/wiki/Au_file_format However it was also used by companies manufacturing samplers and synthesiser. I'd like to preview files from the latter, however I was not able to make my extension run when these files are previewed. To verify my extension works I added an exported UTI with the file extension dmf which is completely owned by my app and preview and opening the files work as expected. However for the snd extension the system always uses the same preview (I assume QuickTime) and it doesn't matter if I associate my app with all files using the file extension. I'm assuming since it's impossible to tell just from the filename what kind of file this is the system just simply assumes it's a Sun file format and uses one of the first part previews, QuickTime or maybe Audio.qlgenerator. Is there any way I could override this behaviour just for this one file extension? (As a side note I guess I could try the older QLGenerator route as well, but I recall not being able to play back audio files with those APIs no matter what I tried) Any help would be welcome.
Replies
0
Boosts
0
Views
903
Activity
Jun ’23
Draco compression in USDZ for Quick Look
Hi, I looked through whole internet searching for some way to compress USDZ files for AR (Quick Look). I see there is some old blog post about Draco compression for USD - https://opensource.googleblog.com/2019/11/google-and-pixar-add-draco-compression.html . Does anyone know if Quick Look supports USDZ files with Draco compression? I haven't found any mention of it in the official documentations :/ Or maybe there is some other way?
Replies
1
Boosts
1
Views
1.7k
Activity
Apr ’23
SwiftUI: quickLookPreview - called while the panel has no controller?
Hello all, I am trying to use quickLookPreview in SwiftUI (macOS) to view a file using quicklook. The following sample code is actually very simple: import SwiftUI import QuickLook struct ContentView: View {     @State var qlURL: URL?     var body: some View {         Button("Show QuickLook") {             qlURL = URL.init(fileURLWithPath: "path to a file")         }         .quickLookPreview($qlURL)     } } At first glance, everything looks great and the specified file is displayed via quicklook. However, I get numerous error messages in the log: 2023-03-10 14:46:58.258051+0100 SwiftUI-Test1[998:5878590] [General] -[QLPreviewPanel setDelegate:] called while the panel has no controller - Fix this or this will raise soon. See comments in QLPreviewPanel.h for -acceptsPreviewPanelControl:/-beginPreviewPanelControl:/-endPreviewPanelControl:. 2023-03-10 14:46:58.258228+0100 SwiftUI-Test1[998:5878590] [General] -[QLPreviewPanel setDataSource:] called while the panel has no controller - Fix this or this will raise soon. See comments in QLPreviewPanel.h for -acceptsPreviewPanelControl:/-beginPreviewPanelControl:/-endPreviewPanelControl:. 2023-03-10 14:46:58.261948+0100 SwiftUI-Test1[998:5878590] [General] -[QLPreviewPanel reloadData] called while the panel has no controller - Fix this or this will raise soon. See comments in QLPreviewPanel.h for -acceptsPreviewPanelControl:/-beginPreviewPanelControl:/-endPreviewPanelControl:. I'm admittedly a bit lost - how are these messages to be understood and how can they be fixed. Xcode 14.2, macOS 13.2, Target: macOS Thanks! Gerald
Replies
2
Boosts
1
Views
1.4k
Activity
Apr ’23
Crash when printing a document from UIActivityViewController or QLPreviewController on iOS 16
Seems like the printing doesn't appear to be worked correctly on iOS 16. We've been getting a lot of crash reports related to printing since iOS 16 was released, for instance print_crash_report.txt Unfortunately, we are unable to reproduce those crashes. This article says that SEGV_MAPERR crash is due to an invalid memory fetch. For this reason, we decided to debug our app with the Address Sanitizer tool enabled in Xcode. As a result, we found out that almost every time the app accesses a freed heap region when the print UI is presented. address_sanitizer_report.txt The were able to reproduce 2 cases in a separated project: Printing a docx file from QLPreviewController Printing the same file from UIActivityViewController passing WKWebView.viewPrintFormatter as an activity item. In order to get the error, once you get to the print UI start scrolling the document preview. See the sample code bellow: import UIKit import WebKit import QuickLook final class PrintCrashViewController: UIViewController { private let webView = WKWebView() /* 27 page document from the app bundle */ private lazy var docFileURL = URL(fileURLWithPath: Bundle.main.path(forResource: "description", ofType: "docx")!) override func loadView() { view = webView } override func viewDidLoad() { super.viewDidLoad() navigationItem.rightBarButtonItems = [ UIBarButtonItem(title: "QL", style: .plain, target: self, action: #selector(openQLPreview)), UIBarButtonItem(title: "Share", style: .plain, target: self, action: #selector(openActivityVC)) ] webView.loadFileURL(docFileURL, allowingReadAccessTo: docFileURL) } @objc private func openActivityVC() { let items: [Any] = [docFileURL, webView.viewPrintFormatter()] let activityVC = UIActivityViewController(activityItems: items, applicationActivities: nil) present(activityVC, animated: true) } @objc private func openQLPreview() { let qlPreviewVC = QLPreviewController() qlPreviewVC.dataSource = self present(qlPreviewVC, animated: true) } } extension PrintCrashViewController: QLPreviewControllerDataSource { func numberOfPreviewItems(in controller: QLPreviewController) -> Int { 1 } func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { docFileURL as NSURL } } Both approaches have been in our app for years.
Replies
1
Boosts
2
Views
1.5k
Activity
Apr ’23
ARKit ARQuickLookPreviewItem only provides API for setting limited subset of potential parameters
ARQuickLookPreviewItem only provides API for specifying values for allowsContentScaling and canonicalWebPageURL parameters. (https://developer.apple.com/documentation/arkit/arquicklookpreviewitem) However, there are many more parameters that can be specified from a link originating from Safari. EG: applePayButtonType, callToAction, checkoutTitle, checkoutSubtitle, price, custom, customHeight (https://developer.apple.com/documentation/arkit/adding_an_apple_pay_button_or_a_custom_action_in_ar_quick_look) It would be great to get support for all these parameters in the ARQuickLookPreviewItem API so that apps can integrate richer features of ARQL.
Replies
0
Boosts
0
Views
613
Activity
Apr ’23
Allowing QuickLook preview to work for all files with a specific extension.
Hi, I have create a Mac app that allows viewing of ".fit" files a file format use to record exercise activities and routes (among other things). I have created a QuickLook Extension to preview these in the finder and this is working fine in most cases if I add file access for this extension in system settings There are serval cases where this does not work, I'm guessing because of the sandbox? e.g. fit files in iCloud Drive just show default QL view not my custom one. Is there a way to allow the QL extension to view a "fit" no matter where it might be? Thanks Ants
Replies
3
Boosts
0
Views
1.2k
Activity
Feb ’23