PDF is very frequently used document type. Especially when you want the read-only document. Many time we need to display PDF in our application. Fortunately, iOS has very Good built-in support for creating and display PDF. If we talk about display only we have many alternatives for that:
- Web view (WKWebView/ UIWebView)
- Third Party PDF reader
Update: iOS 11 gave us a new way to work with PDF – PDFKit. It was on MacOS and now it is on iOS also. If your min app target is iOS 11, I suggest to go for PDFKit instead of this. I will make an post on PDFKit very shortly.
Inbuilt options are a good choice when you just need to display PDF. But if you need more control over PDF you can go with third party reader which provide many features. But sometimes you need in between something or something which is not already provided like different animation, Different page size or something specific to your application. In that kind of situation, you can make your own PDF reader and it is not as hard as it sounds. (Actually it is pretty easy).
So today we will create something like this: