Working with custom user files - ios

I'm currently studying swift and came up with such a question:
What are best practices to work with custom user files like .pdf, .doc?
For instance, I have application, that loads different files from server like .pdf, .ppt, .zip and so on, how to present them inside my app?
While googling I came up with solutions mainly for images, but nothing particular for other file types.
For now, what I have is - downloading files from server using Alamofire and saving them to documents directory.
Could anyone please recommend how to present this files inside my app after I saved them?
Possible solution that comes to my mind is web view, but what about zip? Is there some kind of universal solution? I know that there is Files App in iOS 11, but what about iOS 10?
Many thanks for your attention!

Related

Reading .bundle files in Cocoa Application

I am creating a cocoa web browser using WKWebView and Swift. Like most browsers, they have extensions or plugins. I want to implement the same thing in my web browser. I came across CFPlugin. I want to use this feature but I do not know how. It would be good if you give a sample application.
I haven't tried anything because I don't know what to do
This is how I want my extension to look like
myExtension.bundle/
info.plist
scripts1.js
popoverview.xib
popoverview.swift
script2.js
popuppage.html
image.png
popuppage.css
I want to know how to read the files in the bundle
Thanks!
After a few minutes of trying I found the answer
Bundles are considered as Directories
so you can do something like this
MyBundle.bundle/Contents/Info.plist
MyBundle.bundle/Contents/Resources/MyView.xib

UIDocumentPickerViewController Limitations, Multiple Files selection at once

In order to be able to access iCloud Drive from the application,
I think that we want to use UIDocumentPickerViewController from the application.
but i found following problems when i use UIDocumentPickerViewController.
Cannot upload multiple files at once.
Cannot Download multiple files at once.
When pushViewController from navigationController then display
become strange.
I want to avoid above problems, So is there any another way to get files information from iCloudDrive without using UIDocumentPickerViewController?
like Send some request or query.
I have searched lot and didn't find any query or request to get Files ,Upload files and download files from iCloudDrive.
if you have any idea about this please tell me.
Thanks,
I don't think there's any straightforward alternative, but you could think of...
...using iCloud directly (not iCloud Drive), but then users will only have access to their files from your application
...using Google Drive's sharing extension which supports uploading multiple files at once (the Dropbox SDK probably supports that, too, but their sharing extension doesn't)
...zipping all files before uploading them
...changing the file format so that it's a bundle of multiple files, if you are in control of the file format
...file a radar/feature request, and possibly wait forever ;)
Not sure if that helps, but I don't think you have much of a choice here.

iOS list document from directory download?

I want to allow users of my app to send PDF which is in the device.
The problem is, I don't see how to do that...
First, where are the files downloaded ? In which directory ? And how to list these files ?
I see there is NSfileManager but I don't understand how to use that.
I want something like DocumentPicker. (but available for iOS 7)
There is no common central directory in iOS that stores PDF files in way you describe. Nothing.
Each app has its own Documents folder, and apps have absolutely no way to see each others docs folder. So you, as a new pdf manager custom written app will not be able to look into other apps docs folder.
NSFileManager is a standard Cocoa class the handles files in a generic manner.

Download FTP directory contents to ios

I have a website, let's say it's "http://www.jwilkthings.com/stuff"
I have a bunch of .txt files stored on this website, i.e. "http://www.jwilkthings.com/stuff/text1.txt"
What I'm wanting to do is find a way in iOS to download all of those text files without knowing what the document name is. I can already retrieve them manually as long as I have a file name, but I would rather just get all of them at once and put them in the documents directory if possible. I currently use FileZilla to upload all of the text files, so I can use FTP if needed.
The correct way to solve this problem is to not use FTP (riddled with performance and security issues), and to configure your web server to expose a table of contents directory listing that your client can parse.
But that's not an answer to your question.
If you really want your iOS app to speak FTP, take a look at the SimpleFTP sample project from Apple.
It's old, but I just got it to build on iOS 5. The ListController.m file has the code you're looking for.

Ipad DWG/DXF viewing

I have seen applications for iPad that let you view dxf and dwg files.
Does anyone know where to get info on how to do this? Are there any available tutorials? I haven't been able to find any.
I really need some direction on how to do this. The application I'm making just needs to show the files and layers.
Thanks for any help.
At present RealDwg is not available on iOS platform, so no way to view local dwg/dxf files.
But you have the other option. You create servers which open dwg files and send entities information in some format to your app, then your app can shows them. Through this way, your app can handle extremely large file. See AutoCAD WS.

Resources