Skip to content

fix: iOS 18 error preview, black screen #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adrian000001
Copy link

@adrian000001 adrian000001 commented Feb 12, 2025

Pull Request Title

Fix: Black screen issue in presentPreviewAnimated:YES on iOS 18

Description
This PR introduces a small delay (dispatch_after) before calling presentPreviewAnimated:YES in UIDocumentInteractionController. This fixes an issue in iOS 18, where the preview (QuickLook) sometimes displayed a black screen.

🔍 Issue
On iOS 18, opening certain files with UIDocumentInteractionController resulted in a black screen instead of the expected document preview.

💡 Solution
Added a 0.5-second delay before calling presentPreviewAnimated:YES to ensure the document is fully loaded before rendering the preview.

🛠️ Changes Applied
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self->docController presentPreviewAnimated:YES]; });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant