Implementing Quick Look
Implementing Quick Look requires just a few simple steps:
1. Declare the QLPreviewControllerDataSource protocol in your primary controller class.
2. Implement the numberOfPreviewItemsInPreviewController: and preview-Controller:previewItemAtIndex: data source methods. The first of these methods returns a count of items to preview. The second returns the preview item referred to by the index.
3. Ensure that preview items conform to the QLPreviewItem protocol. This protocol consists of two required properties: a preview title and an item URL. Recipe 11-5 creates a conforming QuickItem class. This class implements an absolutely minimal approach to support the data source.
Once these requirements are met, your code is ready ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access