filmov
tv
Uploading PDF Files iOS [Swift 5 Alamofire SwiftyJSON]
Показать описание
For complete source code refer to my GitHub repo:
Uploading pdf files within your iOS apps is simple and straight forward. Install Alamofire and SwiftyJSON pod.
1) Firstly you have to include two capabilities in your iOS App namely:
1) iCloud
2) KeyChain Sharing
2) Next, you have to generate a container. Go to iCloud Capability then click on “Add a new container" Dailog Box then Paste your Bundle Id then Click on OK button. If you forget to include a container then you will not be able to generate builds for the app.
3) Now switch to your code. Import Alamofire, SwiftyJSON and MobileCoreServices. Subclass UIDocumentMenuDelegate and UIDocumentPickerDelegate. Also, include functions "didPickDocumentsAt", "didPickDocumentPicker" and "documentPickerWasCancelled". Delegate for UIDocumentPicker should set on action for upload button and delegate for UIDocumentMenu should be set in didPickDocumentPicker.
Uploading pdf files within your iOS apps is simple and straight forward. Install Alamofire and SwiftyJSON pod.
1) Firstly you have to include two capabilities in your iOS App namely:
1) iCloud
2) KeyChain Sharing
2) Next, you have to generate a container. Go to iCloud Capability then click on “Add a new container" Dailog Box then Paste your Bundle Id then Click on OK button. If you forget to include a container then you will not be able to generate builds for the app.
3) Now switch to your code. Import Alamofire, SwiftyJSON and MobileCoreServices. Subclass UIDocumentMenuDelegate and UIDocumentPickerDelegate. Also, include functions "didPickDocumentsAt", "didPickDocumentPicker" and "documentPickerWasCancelled". Delegate for UIDocumentPicker should set on action for upload button and delegate for UIDocumentMenu should be set in didPickDocumentPicker.