iOS Tutorial Picking external documents with DocumentPickerViewController

Discussion in 'iOS Tutorials' started by Erel, Nov 15, 2018.

  1. Erel

    Erel Administrator Staff Member Licensed User

    [​IMG]]

    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:
    Code:
    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.
     
    MarcoRome likes this.
  2. Sasuke Sama

    Sasuke Sama Active Member Licensed User

    Thank you it works but for some reason i cant pick any document they all show gray out :(
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Maybe the document type is wrong.
     
  4. Sasuke Sama

    Sasuke Sama Active Member Licensed User

    Dont know i have a pdf file,docx and zip and they are all not pickable
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the relevant code?
     
  6. Sasuke Sama

    Sasuke Sama Active Member Licensed User

    I think i solved it i didnt see the
    "public.image" part o_O thats why it didnt allow me to select other files
    Sorry !! i better get more rest often im starting to lose it XD
     
    Erel likes this.
  7. asubias

    asubias Member Licensed User

    I have the following error in Xcode:
    Code:
    Unknown type name 'B4IDocumentPickerViewController'; did you mean 'UIDocumentPickerViewController'?
    B4i says that i have installed version 1.61 but it seems there is not the methods in my header file.

    EDIT: I got the problem. The last B4iMacBuilder package contains version 1.51 of iUI8. Is out of date. Please, upload the latest version.
     
    Last edited: Mar 1, 2019
  8. Erel

    Erel Administrator Staff Member Licensed User

  9. asubias

    asubias Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice