The goal of this exercise is to analyze the candidate's:
- Organization of code and skills in Swift 5
- Knowlege of connection with an API Rest
- Implementation with 3rd party libraries
Do a small iOS App in Swift that allows: To compress a PDF using the API Rest of https://developer.ilovepdf.com/docs/api-reference (Create a free developer account)
- The PDF is not needed to be selected by the user, it can be done only by clicking a button 'Compress'
- Download the output PDF file and open it with a PDF library of your choice (for instance: PDFKit https://developer.apple.com/documentation/pdfkit)
- Push source code in this repository, no need to create different branches
- Edit this README or create a new one with instructions on how to install the App
Extra points:
- Let the user choose the file to compress from the files in the device
- Let the user choose the level of compression before sendind the PDF to compress to the API Rest
Notes:
- Ask us any doubt regarding the API
- After the interview, none of the code will be used by ILOVEPDF and will be destroyed if the candidate is not hired.
- MVP pattern with use cases and dependency injection.
- Network Layer
- Custom Views
- Base Classes
It contains 5 use cases to process the compression of the PDF with the server and show it compressed in a detail view:
- Get Token
- Start Task
- Upload
- Process
- Download
- Alamofire
First you have to add the PDF example files in the simulator or device.
1 - Open files app:
2 - Select internal storage:
3 - Drag and drop sample PDFs: (Examples included in the repository)
4 - Saved files in local:
1 - Select local PDF example to compress:
2 - Select the compression level and at the end of the process:
3 - The compressed PDF will be displayed on a new screen:
-
To use other public keys, go to the path PDFTest/Credentials/Credentials.plist, modify the public_key field.
-
Enjoy :)