Andrew Zheng
1 min readAug 19, 2020

--

Thanks for the great article!

I fixed some bugs, and put the new version in this Gist.

Note: this version is only for picking files, not folders.

Fixed bugs:

  • inside switch sourceType case .files, you want to use folderURL instead of pickedURL to make the document. According to the documentation, “Always use the URL passed into the block instead of the value in the url parameter.”
  • inside documentFromURL(pickedURL:), missing } underneath pickedURL.stopAccessingSecurityScopedResource().

--

--

Andrew Zheng
Andrew Zheng

Written by Andrew Zheng

WWDC21 Scholar. I like to read manga and write about Swift. Check out my app, Find — look for text in real life, with outrageous speed. getfind.app

No responses yet