Episode #428

Working with the Keychain

25 minutes
Published on February 20, 2020

This video is only available to subscribers. Get access to this video and 569 others.

The Keychain is the best place to store sensitive data such as API keys, auth tokens, and login credentials. On device the data is stored encrypted. Once unlocked, you can retrieve the values you saved, keeping the sensitive data secured by the user's passcode, Face ID, or Touch ID. Using the keychain is not very straightforward, however. It has a low-level C-adapted API and is a little cumbersome to work with. In this episode we will look at how to add, query, and remove items from the keychain, then look at a popular open-source library for making storing values in the keychain much easier to implement.

This episode uses Xcode 11.3.1, Swift 5.1.