SwiftyDropbox list folders only

Viewed 1019

Im using SwiftyDropbox SDK in my iOS application, im trying to list folders only in my app then user can choose a folder (not a file).

in ViewController => viewDidLoad

override func viewDidLoad() {
    super.viewDidLoad()

    guard let dropboxClient = DropboxClientsManager.authorizedClient else{
        return
    }

    let listFolders = dropboxClient.files.listFolder(path: "")
    listFolders.response{ response, error in
        guard let result = response else{
            return
        }

        for entry in result.entries{
            print(entry)
        }
    }
    // Do any additional setup after loading the view, typically from a nib.
}

entry is >

  { 
      id = "id:0GMPvYwuVEAAAAAAAAAABw";
      name = "Folder A";
      "path_display" = "/Folder A";
      "path_lower" = "/folder a";
  }

how can i find this entry is folder and it contains sub folder or not?

2 Answers
Related