Skip to content

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