How to access iCloud Drive or Google Drive Data in application using Swift 3

Updated 26 October 2021

Save

iCloud Drive or Google Drive

Some times we need to access the data in application like we need to upload the data to server or send to someone using the application so default iOS device provide only photo library to access but we need all types of file in one place due to this reason we need to access the google or iCloud drive.

iOS provide classes to use this functionality but respective drive application must be installed in the devices;

Follow this steps:

1: add this two delegate in class where you want to use.

like as:

2: Now create one button so you can click and access the data :

Here i have taken one button and write this code:

Note:

for documnetTypes:

Here I have mentioned only images so you have to pass all types of file extension whatever you need .

3: Now write their delegate so you can pick the selected data.

4: this delegate method will be called now, their methods definition

A: documentpicker: this method will called if have selected any file in drive then it will provide the url through which you can access the data and open in web service or share to other.

B:  documentPickerWasCancelled : when user did not select any items.

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home