WWDC24 SALE: Save 50% on all my Swift books and bundles! >>


Found 12 articles in the Swift Knowledge Base for this category.


How to convert speech to text using SFSpeechRecognizer

iOS has a built-in speech transcription system, which allows you to convert any audio recording into a text stream. It takes a few steps to configure, so let’s walk through them.... Continue Reading >>

How to display PDFs using PDFView

Apple’s PDFKit framework provides a huge range of code to help us work with PDFs, and one of the most useful is PDFView – it renders PDFs to the screen and lets users interact with them.... Continue Reading >>

How to extract text from a PDF using PDFKit

PDFKit comes with a built-in class called PDFDocument, which allows us to load and parse PDF documents. It’s used when you want to put your PDF into a PDFView, but it’s also useful when you just want to read text from the PDF: you can loop over each page in the PDF, read its attributedString property, then append it to an attributed string containing all the text from the PDF.... Continue Reading >>

How to get a Cover Flow effect on iOS

You can get an instant Cover Flow effect on iOS by using the marvelous and free iCarousel library. You can download it from https://github.com/nicklockwood/iCarousel and drop it into your Xcode project fairly easily by adding a bridging header (it's written in Objective-C).... Continue Reading >>

How to make empty UITableViews look more attractive using DZNEmptyDataSet

If you use table views or collection views and you want to take one simple step to make your app both more attractive and more user-friendly, let me tell you what the pros do: we use DZNEmptyDataSet. This simple, free, open source library is designed to handle the case when your data source is empty by showing some prompt text, and optionally also a button or an image.... Continue Reading >>

How to parse JSON using SwiftyJSON

SwiftyJSON is a super-simplified JSON parsing library that gives you clearer syntax than the built-in iOS libraries (yes, even more than JSONEncoder from Codable), and is free.... Continue Reading >>

How to preview files using Quick Look and QLPreviewController

Apple’s Quick Look framework lets you embed previewing for a huge range of file types, including iWork documents, Microsoft Office documents, PDFs, images, and more, all without writing much code. ... Continue Reading >>

How to scan NFC tags using Core NFC

Any iPhones since the iPhone 7 are able to scan any NFC tags you have around, and it doesn’t take much work – iOS even provides default user interface for you.... Continue Reading >>

How to search your app’s Spotlight index

If you choose to index your app’s content using Spotlight (and you should), you can then use more Core Spotlight code to search your own index from inside your app.... Continue Reading >>

How to show PDF thumbnails using PDFThumbnailView

Apple’s PDFKit framework provides a huge range of code to help us work with PDFs, including a dedicated view for rendering thumbnails of PDF pages: PDFThumbnailView. However, using it takes a little extra work because it doesn’t read PDF directly – you first load the PDF into a PDFView, then connect that to the thumbnail view.... Continue Reading >>

How to watermark PDFs inside a PDFView

PDFKit makes it easy to watermark PDFs as they are rendered, for example to add “FREE SAMPLE” over pages. It takes six steps, five of which are trivial and one which involves a little Core Graphics heavy lifting.... Continue Reading >>

What is CloudKit?

CloudKit is Apple’s dedicated back-end service for your apps, allowing you to store user data and assets remotely entirely using Swift. It works similar to Core Data, although it’s much simpler in practice – you can save any kind of Swift data you like, and CloudKit takes care of the rest.... Continue Reading >>

About the Swift Knowledge Base

This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions, all written for Swift.

Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.