I copied some bits of code from apple\'s documentation- and I got these 2 errors:
Undefined symbols for architecture i386:
\"_kUTTypeImage\", referenced f
Obligatory Swift answer:
import MobileCoreServices
Look up the symbol (kUTTypeImage
) and locate the image/library it should exist in (MobileCoreServices.framework
in this case). Then link your binary with that framework.
When use with UIDocumentPickerViewController
do:
import MobileCoreServices
let type = String(kUTTypeImage)
let documentPickerViewController = UIDocumentPickerViewController(documentTypes: [type], in: .import)