Reputation: 778
I am a newbie to iOS, I have a created a textfield and imageView in a ViewController. I want user of app to select an image or a file(.txt,.csv, etc)into the App. I know that Apple provides UIImagePicker to select images from the device. with these I added an image to my imageView.
Now I want to Know that is there any way to select files from the device and use it into application. Or else Open file system of device and select the file ?
When I Googled it, I got that you are not able to open the file system. So how can I implement this functionality in iOS app?
Upvotes: 1
Views: 939
Reputation: 2294
There is no way of selecting file from file system into application. You can only access files from
There are multiple ways from which you can select files of different types other than images are
So create one UIButton
like "Select File" and open UIActionSheet
on tap of it. UIActionSheet
will have options like
And you can call respective actions on each index
.
Upvotes: 1
Reputation: 56
you can not load files directly from file system, but you can load them from some third party applications like Documents and cloud sources like iCloud and Drop Box with UIDocumentPickerViewController
Upvotes: 0
Reputation: 2966
You can use UIDocumentPickerViewController
if you enable iCloud document support for your app.
Upvotes: 0
Reputation: 596
You can pick your documents and images and other files by using separator picker for each like
for Documents - UIDocumentPickerViewController
for Images/Videos - UIImagePickerController
Apple does not provide a direct picker for all files. Hope this is working for you. :)
Upvotes: 0