Using the UIDocumentPickerViewController, is it possible to show a default service (Dropbox, Google Drive, etc) on first open like in Slack?

后端 未结 3 1939
青春惊慌失措
青春惊慌失措 2021-02-01 04:24

Normally, the behavior with UIDocumentPicker is that you present, then the user must use the \"Locations\" menu on the top right to switch between the services. Is it possible t

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-01 05:03

    Swift code example:

    let documentProvider = UIDocumentMenuViewController(documentTypes: ["public.image", "public.audio", "public.movie", "public.text", "public.item", "public.content", "public.source-code"], in: .import) 
    documentProvider.delegate = self
    
    self.present(documentProvider, animated: true, completion: nil)
    

提交回复
热议问题