Libraries - free Swift example code
About 3 min
Libraries - free Swift example code êŽë š
Libraries - free Swift example code
Learn Swift coding for iOS with these free tutorials â learn Swift, iOS, and Xcode
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....
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....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....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)....
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....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....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....
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....
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....
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....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....
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....