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

QuickLook Preview Extension for Mac app
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?
1
0
1.4k
May ’22
Is QLSupportsSearchableItems:true required for document-based app quicklook-extension for MacCatalyst?
The WWDC '17 session for core spotlight said QLSupportsSearchableItems is only for "shoebox" apps and explicitly said it's not for document-based apps, but when trying to upload my UIDocumentBrowserViewController-based MacCatalyst app with a quicklook extension (the view-controller-based quicklook preview works great) to App Store connect, it prevents me from uploading without a QLSupportsSearchableItems keys in my quicklook extension's info.plist, and it prevents me from uploading it if the value is false (0). Is the app store validator correct, and I must have this key and it must be true? Do I have to implement func preparePreviewOfSearchableItem(identifier, and if so, can I just have it always fail? If it can't fail, how would I get a sandbox url for the document from a searchable item identifier? Also, Xcode won't find anything when I search for QLSupportsSearchableItems, which is not so much ironic as it is face-palmy.
0
1
954
May ’22
QuickLook environment probes are always much too dark
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
2
1
2.3k
May ’22
How to initiate the quicklook in object mode?
How to initiate the quicklook in object mode directly (but you can still switch the slider to AR if you like)? func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { let url = Bundle.main.url(forResource: modelsName[selectedModelIndex], withExtension: "usdz")! return url as QLPreviewItem
0
0
643
May ’22
Open Quick Look from protected web space directory with Model Viewer
Hi Community, I am using Googles Model Viewer (https://modelviewer.dev/) to display 3D-models in the webbrowser. It also enables the user to open the 3D-models in AR-Applications. On iOS, Quick Look will be opened. It all works fine and well, except when the web space directory is protected by HTTP Basic Auth (protection of the usdz-model-files is a requirement of my client). As I understand it, Quick Look looses (or does not have any access to) the HTTP session, and therefore is not authenticated when trying to access the usdz-file on the protected web space directory. The error message in Quick Look is: "Object requires a newer version of iOS". Is there any way to open an usdz-file that is on a protected web space directory with Quick Look?
0
0
541
Mar ’22
Sandbox: ExternalQuickLoo(1253) deny(1) network-outbound*:42222
I've got an app with a quicklook generator bundled within it. The app opens port 42222 for localhost queries. The quicklook generator fails to connect to the socket. The log shows these 2 sandbox errors: Sandbox: 1 duplicate report for java deny(1) file-read-data /private/etc/hosts Sandbox: ExternalQuickLoo(1253) deny(1) network-outbound*:42222 ... which is weird because the app isn't sandboxed: % codesign -d --entitlements :- /Applications/Test.app                                                          Executable=/Applications/Test.app/Contents/MacOS/Test The same code functions correctly when executed from a separate app running on the same machine (rather than from the generator). Any idea why the quicklook generator isn't able to connect to a localhost socket? ... or why sandbox rules are being applied to a non-sandbox app?
3
0
1.1k
Mar ’22
QuickLook preview never displays NSImageView
I have an NSImageView-based preview appex plugin for macOS in Objective-C. It's based off the sample template that you can add to an app. It completely makes it through preparePreviewOfFileAtURL, and I stuff pixel data into a CGImage, then that into an NSImage and that onto an NSImageView that is self.view from the storyboard. I can see all data via qlManager -p, since it will print error messages for caveman debugging. I have no idea and there are no docs on using the "Quick Look Simulator" which appears to do nothing. I set background color of the NSImageView.layer to red, and it shows up red. So I know the NSImageView is visible, just not the image that it also points to. About 30% of the time, only the red shows up, and the other 70% of the time nothing shows up in preview just smokey blurred version of the icons underneath in Finder. My only recourse, is to disable the extension list for the preview appex, and let the thumbnailer appex provide the preview. There are no samples of this for macOS, and the default templates aren't a working version of this either.
1
0
836
Feb ’22
Reality files do not open on iOS15
We create reality files on Reality Composer on an iPad Pro 2020 (iPad OS 14.8.1). They can be opened in AR correctly on iOS 14 devices (our iPad & an iPhone 12 Pro). However on our iOS 15 iPhone X (iOS 15.2.1), AR Quick Look opens but it displays an error message saying “the object cannot be opened”. I have tried creating a .reality file on Reality Composer directly on my iOS 15 iPhone X (I just exported the template project for horizontal plane tracking), but the export fails to open on the very same device. However, the file generated on my iOS 15 iPhone X opens fine on my iPad Pro (iPad OS 14.8.1). USDZ files work fine on iOS though. Any lead on how to solve this issue?
4
0
2.2k
Feb ’22
Quick Look AR not accessible in in-app browers // iOS 15.8
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
3
0
1.7k
Feb ’22
AR Quick View's AR Quick View button cannot be pressed on some iOS devices.
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.
7
0
3.7k
Jan ’22
Does drawViewHierarchyInRect work with QLPreviewController?
I'm seeing an issue using [UIView drawViewHierarchyInRect:afterScreenUpdates:] to take an app "screenshot". Specifically, I'm seeing that a PDF rendered using QLPreviewController doesn't render in the screenshot when the code is run on a device. I'm using this UIView API in conjunction with UIGraphicsBeginImageContextWithOptions and UIGraphicsEndImageContext - the simplified code is as follows: UIWindow *appWindow = [[[UIApplication sharedApplication] delegate] window]; UIGraphicsBeginImageContextWithOptions(imageSize, NO, 1.0); CGContextRef graphicsContext = UIGraphicsGetCurrentContext(); BOOL result = [appWindow drawViewHierarchyInRect:screenBounds afterScreenUpdates:NO]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); and I'm setting up my QLPreviewController as follows: - (void)pdfButtonTapped:(nonnull UIButton *)button { QLPreviewController *nextViewController = [QLPreviewController new]; nextViewController.dataSource = self; [self presentViewController:nextViewController animated:YES completion:nil]; } #pragma mark - QLPreviewControllerDataSource - (NSInteger)numberOfPreviewItemsInPreviewController:(nonnull QLPreviewController *)controller { return 1; } - (nonnull id<QLPreviewItem>)previewController:(nonnull QLPreviewController *)controller previewItemAtIndex:(NSInteger)index { return [NSBundle.mainBundle URLForResource:@"menu_web_november" withExtension:@"pdf"]; } I'm running this code on both device and simulator: Device: iPad (6th generation), iOS 15.2 [Screen 1024x768] Simulator: iPad (9th generation), iOS 15.2, Xcode 13.2.1 (13C100) [Screen 1080x810] The results I'm seeing differ between simulator and device. On device, I see that only the navigation bar is rendered into the final image: On simulator, I see that the full view (including the PDF) is rendered into the final image: On both device and simulator, the result returned from the [UIView drawViewHierarchyInRect:afterScreenUpdates:] call is YES. I'm capturing these screenshots by setting a breakpoint in the code after UIGraphicsEndImageContext(), choosing the image variable in the debug inspector and pressing the "eye" button but note that these are the results I see when running the code in release too. I have a couple of questions about these results: Is it expected that QLPreviewController contents (for PDF at least) don't render in the snaphot image on device Is it expected that QLPreviewController contents (for PDF at least) do render in the snaphot image on simulator If this behaviour is expected, is there a way of telling which UIView subclasses are "compatible" with the [UIView drawViewHierarchyInRect:afterScreenUpdates:] API and which UIView subclasses won't render their contents in a snapshot? Thanks for your help in advance, Ceri
2
0
1.2k
Jan ’22
How to view the image(cv::mat) in the debug mode in xcode
Recently, I am learning some knowledge about OpenCV on Mac, refer to the online tutorial to configure OpenCV of C++ on Xcode, and implement some simple examples on Xcode. The biggest problem encountered is how to preview the image in debug mode. The cv::Mat image cannot be previewed directly, which is very unfriendly for debugging. I also found some solutions to this problem on the Internet, and these results are disappointing, at least for me as a programming beginner. I hope that this function implemented by xcode has the corresponding "OpenCV Image Viewer" plug-in on other IDEs on Mac such as Pycharm and CLion, and the "Image Watch" plug-in corresponding to Visual Studio on Windows. For me, this feature is necessary. According to this idea, is it a wrong choice to learn OpenCV C++ with Xcode, and embracing CLion on a Mac is the best choice for me? (Considering that Xcode is an IDE for Swift, I don't know much about Swift.) The process of implementing these simple examples on Xcode is still very enjoyable. I like Xcode's UI design. Therefore, I still hope that there is the best way to solve this problem in Xcode. The following is an example of running C++ OpenCV on Xcode: Xcode Version: 13.2.1 (13C100) OpenCV Version: stable 4.5.3 (bottled)
0
0
1.6k
Jan ’22
UIKeyCommand in QLPreviewController in iOS 15
With iOS 15 there are changes to keyboard handling. Besides usual overriding of keyCommands a programmer has to assign own commands higher priority than system commands. So, the following code works for me: final class MyViewController: UIViewController { override var keyCommands: [UIKeyCommand]? { let action = UIKeyCommand(input: UIKeyCommand.inputUpArrow, modifierFlags: [], action: #selector(myAction)) if #available(iOS 15, *) { action.wantsPriorityOverSystemBehavior = true } return [action] } // rest of the code } On the other hand, almost the same code but with inheriting from QLPreviewController doesn't work: final class PreviewViewController: QLPreviewController { // same internals as above } In view hierarchy I spotted that there is actually some kind of extra navigation, maybe that is stealing my keyboard presses, maybe that's why above code isn't working. Does anyone have an idea how to fix or workaround this issue? Obviously, the extra navigation is from Apple and I don't have access to these extra presented controllers. I was trying to print the following details, but neither helps: print(presentedViewController ?? "none") // output: none print(topMostViewController) // output: <MyApp.PreviewViewController: 0x7fbe44156203> print(inputViewController ?? "none") // output: none It's worth to add I've also tried to add method override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { print("test?") super.pressesBegan(presses, with: event) } And test never appears in the console, whatever button I press. So clearly something else steals the key presses. This did not happen before iOS 15. I conclude it, thinking it may be a bug in the API. Probably just no one thought of this scenario when adding the new keys..?
0
0
680
Dec ’21
QuickLook Preview saving errors or no saving
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!
2
0
1.7k
Nov ’21
QuickLook Preview Extension for Mac app
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?
Replies
1
Boosts
0
Views
1.4k
Activity
May ’22
Is QLSupportsSearchableItems:true required for document-based app quicklook-extension for MacCatalyst?
The WWDC '17 session for core spotlight said QLSupportsSearchableItems is only for "shoebox" apps and explicitly said it's not for document-based apps, but when trying to upload my UIDocumentBrowserViewController-based MacCatalyst app with a quicklook extension (the view-controller-based quicklook preview works great) to App Store connect, it prevents me from uploading without a QLSupportsSearchableItems keys in my quicklook extension's info.plist, and it prevents me from uploading it if the value is false (0). Is the app store validator correct, and I must have this key and it must be true? Do I have to implement func preparePreviewOfSearchableItem(identifier, and if so, can I just have it always fail? If it can't fail, how would I get a sandbox url for the document from a searchable item identifier? Also, Xcode won't find anything when I search for QLSupportsSearchableItems, which is not so much ironic as it is face-palmy.
Replies
0
Boosts
1
Views
954
Activity
May ’22
QuickLook environment probes are always much too dark
It seems that on iOS 13 &amp; 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
Replies
2
Boosts
1
Views
2.3k
Activity
May ’22
How to initiate the quicklook in object mode?
How to initiate the quicklook in object mode directly (but you can still switch the slider to AR if you like)? func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { let url = Bundle.main.url(forResource: modelsName[selectedModelIndex], withExtension: "usdz")! return url as QLPreviewItem
Replies
0
Boosts
0
Views
643
Activity
May ’22
Quick Look
Hi! I'm new to Apple developing. Could anyone please tell me how to configure a quick look for my document? Also, how to print my document? Thanks🙏
Replies
1
Boosts
0
Views
1.5k
Activity
May ’22
QLPreviewController doesn't ask for camera permission when previewing AR files
Our app uses QLPreviewController for previewing files. We've recently discovered that previewing AR (reality) files bypasses accessing the device’s camera without the app first requesting if it can use the device’s camera.
Replies
1
Boosts
0
Views
1.1k
Activity
May ’22
How to hide share/action button from QLPreviewController in iOS 10.X
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.
Replies
3
Boosts
0
Views
3.8k
Activity
Mar ’22
Open Quick Look from protected web space directory with Model Viewer
Hi Community, I am using Googles Model Viewer (https://modelviewer.dev/) to display 3D-models in the webbrowser. It also enables the user to open the 3D-models in AR-Applications. On iOS, Quick Look will be opened. It all works fine and well, except when the web space directory is protected by HTTP Basic Auth (protection of the usdz-model-files is a requirement of my client). As I understand it, Quick Look looses (or does not have any access to) the HTTP session, and therefore is not authenticated when trying to access the usdz-file on the protected web space directory. The error message in Quick Look is: "Object requires a newer version of iOS". Is there any way to open an usdz-file that is on a protected web space directory with Quick Look?
Replies
0
Boosts
0
Views
541
Activity
Mar ’22
Sandbox: ExternalQuickLoo(1253) deny(1) network-outbound*:42222
I've got an app with a quicklook generator bundled within it. The app opens port 42222 for localhost queries. The quicklook generator fails to connect to the socket. The log shows these 2 sandbox errors: Sandbox: 1 duplicate report for java deny(1) file-read-data /private/etc/hosts Sandbox: ExternalQuickLoo(1253) deny(1) network-outbound*:42222 ... which is weird because the app isn't sandboxed: % codesign -d --entitlements :- /Applications/Test.app                                                          Executable=/Applications/Test.app/Contents/MacOS/Test The same code functions correctly when executed from a separate app running on the same machine (rather than from the generator). Any idea why the quicklook generator isn't able to connect to a localhost socket? ... or why sandbox rules are being applied to a non-sandbox app?
Replies
3
Boosts
0
Views
1.1k
Activity
Mar ’22
QuickLookUIService preview Stop Working in Sierra
Somehow my QuickLookUIService Preview Sierra 10.12 has stopped working and cannot preview audio files neither with video files ... I have tried to Force Quit in activity Monitor but the file QuickLookUIService doesn´t appear to be in the system so it is not in the Library Folder Quick Look. Any solution for this? Thanks!
Replies
0
Boosts
1
Views
817
Activity
Feb ’22
Why no Quicklook with fileprovider?
Hi, When using FileProvider, files visualised in Finder does not trigger a download to visualise or audition the file when hitting space (for quicklook) Can this be configured somehow?
Replies
2
Boosts
0
Views
1.2k
Activity
Feb ’22
QuickLook preview never displays NSImageView
I have an NSImageView-based preview appex plugin for macOS in Objective-C. It's based off the sample template that you can add to an app. It completely makes it through preparePreviewOfFileAtURL, and I stuff pixel data into a CGImage, then that into an NSImage and that onto an NSImageView that is self.view from the storyboard. I can see all data via qlManager -p, since it will print error messages for caveman debugging. I have no idea and there are no docs on using the "Quick Look Simulator" which appears to do nothing. I set background color of the NSImageView.layer to red, and it shows up red. So I know the NSImageView is visible, just not the image that it also points to. About 30% of the time, only the red shows up, and the other 70% of the time nothing shows up in preview just smokey blurred version of the icons underneath in Finder. My only recourse, is to disable the extension list for the preview appex, and let the thumbnailer appex provide the preview. There are no samples of this for macOS, and the default templates aren't a working version of this either.
Replies
1
Boosts
0
Views
836
Activity
Feb ’22
QLPreviewController pdf edit not working properly
i,m loading pdf in QLPreviewController, pdf has more than 5 pages, im editing pdf one by one till last page and giving print, in print preview screen its not showing proper edited pdf. seems like first two edited page showing. remaining pages are seems like not edited screen
Replies
0
Boosts
0
Views
536
Activity
Feb ’22
Reality files do not open on iOS15
We create reality files on Reality Composer on an iPad Pro 2020 (iPad OS 14.8.1). They can be opened in AR correctly on iOS 14 devices (our iPad & an iPhone 12 Pro). However on our iOS 15 iPhone X (iOS 15.2.1), AR Quick Look opens but it displays an error message saying “the object cannot be opened”. I have tried creating a .reality file on Reality Composer directly on my iOS 15 iPhone X (I just exported the template project for horizontal plane tracking), but the export fails to open on the very same device. However, the file generated on my iOS 15 iPhone X opens fine on my iPad Pro (iPad OS 14.8.1). USDZ files work fine on iOS though. Any lead on how to solve this issue?
Replies
4
Boosts
0
Views
2.2k
Activity
Feb ’22
Quick Look AR not accessible in in-app browers // iOS 15.8
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
Replies
3
Boosts
0
Views
1.7k
Activity
Feb ’22
AR Quick View's AR Quick View button cannot be pressed on some iOS devices.
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.
Replies
7
Boosts
0
Views
3.7k
Activity
Jan ’22
Does drawViewHierarchyInRect work with QLPreviewController?
I'm seeing an issue using [UIView drawViewHierarchyInRect:afterScreenUpdates:] to take an app "screenshot". Specifically, I'm seeing that a PDF rendered using QLPreviewController doesn't render in the screenshot when the code is run on a device. I'm using this UIView API in conjunction with UIGraphicsBeginImageContextWithOptions and UIGraphicsEndImageContext - the simplified code is as follows: UIWindow *appWindow = [[[UIApplication sharedApplication] delegate] window]; UIGraphicsBeginImageContextWithOptions(imageSize, NO, 1.0); CGContextRef graphicsContext = UIGraphicsGetCurrentContext(); BOOL result = [appWindow drawViewHierarchyInRect:screenBounds afterScreenUpdates:NO]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); and I'm setting up my QLPreviewController as follows: - (void)pdfButtonTapped:(nonnull UIButton *)button { QLPreviewController *nextViewController = [QLPreviewController new]; nextViewController.dataSource = self; [self presentViewController:nextViewController animated:YES completion:nil]; } #pragma mark - QLPreviewControllerDataSource - (NSInteger)numberOfPreviewItemsInPreviewController:(nonnull QLPreviewController *)controller { return 1; } - (nonnull id<QLPreviewItem>)previewController:(nonnull QLPreviewController *)controller previewItemAtIndex:(NSInteger)index { return [NSBundle.mainBundle URLForResource:@"menu_web_november" withExtension:@"pdf"]; } I'm running this code on both device and simulator: Device: iPad (6th generation), iOS 15.2 [Screen 1024x768] Simulator: iPad (9th generation), iOS 15.2, Xcode 13.2.1 (13C100) [Screen 1080x810] The results I'm seeing differ between simulator and device. On device, I see that only the navigation bar is rendered into the final image: On simulator, I see that the full view (including the PDF) is rendered into the final image: On both device and simulator, the result returned from the [UIView drawViewHierarchyInRect:afterScreenUpdates:] call is YES. I'm capturing these screenshots by setting a breakpoint in the code after UIGraphicsEndImageContext(), choosing the image variable in the debug inspector and pressing the "eye" button but note that these are the results I see when running the code in release too. I have a couple of questions about these results: Is it expected that QLPreviewController contents (for PDF at least) don't render in the snaphot image on device Is it expected that QLPreviewController contents (for PDF at least) do render in the snaphot image on simulator If this behaviour is expected, is there a way of telling which UIView subclasses are "compatible" with the [UIView drawViewHierarchyInRect:afterScreenUpdates:] API and which UIView subclasses won't render their contents in a snapshot? Thanks for your help in advance, Ceri
Replies
2
Boosts
0
Views
1.2k
Activity
Jan ’22
How to view the image(cv::mat) in the debug mode in xcode
Recently, I am learning some knowledge about OpenCV on Mac, refer to the online tutorial to configure OpenCV of C++ on Xcode, and implement some simple examples on Xcode. The biggest problem encountered is how to preview the image in debug mode. The cv::Mat image cannot be previewed directly, which is very unfriendly for debugging. I also found some solutions to this problem on the Internet, and these results are disappointing, at least for me as a programming beginner. I hope that this function implemented by xcode has the corresponding "OpenCV Image Viewer" plug-in on other IDEs on Mac such as Pycharm and CLion, and the "Image Watch" plug-in corresponding to Visual Studio on Windows. For me, this feature is necessary. According to this idea, is it a wrong choice to learn OpenCV C++ with Xcode, and embracing CLion on a Mac is the best choice for me? (Considering that Xcode is an IDE for Swift, I don't know much about Swift.) The process of implementing these simple examples on Xcode is still very enjoyable. I like Xcode's UI design. Therefore, I still hope that there is the best way to solve this problem in Xcode. The following is an example of running C++ OpenCV on Xcode: Xcode Version: 13.2.1 (13C100) OpenCV Version: stable 4.5.3 (bottled)
Replies
0
Boosts
0
Views
1.6k
Activity
Jan ’22
UIKeyCommand in QLPreviewController in iOS 15
With iOS 15 there are changes to keyboard handling. Besides usual overriding of keyCommands a programmer has to assign own commands higher priority than system commands. So, the following code works for me: final class MyViewController: UIViewController { override var keyCommands: [UIKeyCommand]? { let action = UIKeyCommand(input: UIKeyCommand.inputUpArrow, modifierFlags: [], action: #selector(myAction)) if #available(iOS 15, *) { action.wantsPriorityOverSystemBehavior = true } return [action] } // rest of the code } On the other hand, almost the same code but with inheriting from QLPreviewController doesn't work: final class PreviewViewController: QLPreviewController { // same internals as above } In view hierarchy I spotted that there is actually some kind of extra navigation, maybe that is stealing my keyboard presses, maybe that's why above code isn't working. Does anyone have an idea how to fix or workaround this issue? Obviously, the extra navigation is from Apple and I don't have access to these extra presented controllers. I was trying to print the following details, but neither helps: print(presentedViewController ?? "none") // output: none print(topMostViewController) // output: <MyApp.PreviewViewController: 0x7fbe44156203> print(inputViewController ?? "none") // output: none It's worth to add I've also tried to add method override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { print("test?") super.pressesBegan(presses, with: event) } And test never appears in the console, whatever button I press. So clearly something else steals the key presses. This did not happen before iOS 15. I conclude it, thinking it may be a bug in the API. Probably just no one thought of this scenario when adding the new keys..?
Replies
0
Boosts
0
Views
680
Activity
Dec ’21
QuickLook Preview saving errors or no saving
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!
Replies
2
Boosts
0
Views
1.7k
Activity
Nov ’21