You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 13, 2019. It is now read-only.
FileManager.url(forUbiquityContainerIdentifier:) is currently being called on the main thread, against Apple's guidance.
Details
At the moment you are instantiating the shared DocumentManager in the DocumentBrowserViewController.viewDidLoad (), which is happening on the main thread.
When you step through the initialisation of the DocumentManager, you eventually get to a call for the cloudDocumentsURL property which is where the call to FileManager.url(forUbiquityContainerIdentifier:) happens.
This goes against Apple's guidance for FileManager.url(forUbiquityContainerIdentifier:) that it should not be called from the main thread.
Important
Do not call this method from your app’s main thread. Because this method might take a nontrivial amount of time to set up iCloud and return the requested URL, you should always call it from a secondary thread. To determine if iCloud is available, especially at launch time, check the value of the ubiquityIdentityToken property instead.
Summary
FileManager.url(forUbiquityContainerIdentifier:)is currently being called on the main thread, against Apple's guidance.Details
At the moment you are instantiating the shared
DocumentManagerin theDocumentBrowserViewController.viewDidLoad (), which is happening on the main thread.textor/Textor/Controller/DocumentBrowserViewController.swift
Lines 11 to 17 in f97306e
When you step through the initialisation of the
DocumentManager, you eventually get to a call for thecloudDocumentsURLproperty which is where the call toFileManager.url(forUbiquityContainerIdentifier:)happens.textor/Textor/Util/DocumentManager.swift
Lines 60 to 66 in f97306e
This goes against Apple's guidance for
FileManager.url(forUbiquityContainerIdentifier:)that it should not be called from the main thread.Link to full Apple documentation: https://developer.apple.com/documentation/foundation/filemanager/1411653-url