iUI8 v1.60 adds a new type named DocumentPickerViewController. This picker allows the user to choose an external document. The document will be imported (copied) to your app file system.
Example:
B4X:
Sub Page1_Click
DocumentPicker.InitializeImport("picker", Array("public.image"))
DocumentPicker.Show(Page1, Button1)
Wait For Picker_Complete (Success As Boolean, URLs As List)
If Success Then
ImageView1.Bitmap = LoadBitmap(URLs.Get(0), "")
End If
End Sub
- List of common document types: https://developer.apple.com/library...es/System-DeclaredUniformTypeIdentifiers.html
- In case of file URLs the URL is converted to a file path automatically.
- Note that you should add #MinVersion: 8 when using iUI8 library.