amosavian / FileProvider

FileManager replacement for Local, iCloud and Remote (WebDAV/FTP/Dropbox/OneDrive) files -- Swift
MIT License
56 stars 14 forks source link

SearchFiles jumps to main thread and blocks UI #164

Open JeanetteMueller opened 4 years ago

JeanetteMueller commented 4 years ago

Inside of CloudFileProvider the Method searchFiles add an observer with block. This Block runs in main thread. in my case it hase to check over 35.000 files and blocks the UI for 4-10 seconds.

the end of the block jumps back to background queue.

I moved the row

self.dispatch_queue.async {

to the beginning of the block and everything works fine.