Frameworks course for iOS apps #3. Quicklook – View any type of document – .com

In this class we will see how to display any type of document in your applications with Quicklook and reviewControllerViewController.

In applications it is very common to present documents of all kinds, and Apple makes the task much easier with QuickLook.

The Quicklook Framework is a small repository of classes and protocols that will basically allow us to orchestrate the entire operation of displaying documents in a special view that Apple has created for us.

In this view we can zoom in on the document, “pinch” this gesture of pinching the screen and increase or decrease the zoom; It also provides us with a share button, in this way we will use the standard Apple way to share a document either by email, AirDrop, or any messaging App or Social Networks that we have on our device, and best of all: Without programming any of this!

We are going to watch the video tutorial where you will learn how to use the Framework in a practical class in which we will show a PDF file.

Simple right? Apple has done all the hard work for us, so our job is to use the Framework objects to display the document.

Notice how Apple uses delegation through protocols, how our view controller communicates with the view itself, this is the delegate pattern, and Apple will use it constantly in its Frameworks.

As we have seen, we have used the QLPreviewItem protocol to show this preview and interact with the document as we have mentioned before.

Notice how we have created a class called PreviewControllerViewController which is the one that holds all the logic to display the document, so our controller only has to execute a couple of lines of code to display the document. This has to do with giving our project a certain modularity, or in other words, applying the MVC pattern (Model, View, Controller).

See also  eCommerce course #3. CMS Platforms - .com

I leave you as “homework” to be able to view another document such as a Word file, a txt, or any other document that occurs to you, and here it is in case you want to take a look at it.

As always, if you have any questions, you can use the contact form on the intranet, and Sergio will be happy to assist you. See you in the next lesson!

Remember that if you will have access to everybody the courses and you can also enjoy everything from .

All chapters in this course:

Loading Facebook Comments ...
Loading Disqus Comments ...