iOS Keychain Access with Locksmith Tutorial (Cocoapod Install)

Learn how to use Locksmith to securely store sensitive data in your app. Don’t use NSUserDefaults to store things like passwords and API keys! Locksmith stores the data in the keychain which is the secure storage on iOS. We will be doing this in a Swift Xcode project.

We’ll be installing Locksmith with the Cocoa Pod set up so if you missed the video on how to install and set up Cocoapods, check it out here:

Related Links:

Xcode project, source code and video download:

GitHub Page

For more tutorials on how to build iPhone apps, make sure you subscribe and visit my site where you’ll find a community of like minded learners! Learning something new is always more fun with other people!


CodeWithChris is dedicated to teaching beginners and non-programmers all about building iOS apps. On the site, you’ll find a ton of free resources and tutorials to aid you on your journey to learn iOS development. Many people have successfully picked up Swift, Objective-C, Xcode and app building from my course and materials!

Intro & Outro music
“Heartbreaker” by Jahzzar (






13 responses to “iOS Keychain Access with Locksmith Tutorial (Cocoapod Install)”

  1. Sharkes Monken Avatar

    Is this still an effective library to use ? @CodeWithChris Since it's a long time video 2015.

  2. Віталій Кравець Avatar

    Thanks for the tutorial! What is the difference between using Locksmith, Firebase and OAuthSwift when logging in with Email and Password?

  3. mohammad faani Avatar

    Chris, Thanks for this simple made video.

    as for `forUserAccount` does that mean if I have a device, that could be used for multiple users, I should somehow capture the username/userID there instead of the AppName?

  4. reilem Avatar

    After following all the instructions and after attempting to build, multiple .swift files including Locksmith.swift had around 50 errors between them. It's all out of date code.

    EDIT: Turns out I was still using swift 2.3 instead of swift 3. My bad! 🙂

  5. Julien Fadel Avatar

    Equivalent library for objective-c, if possible.
    Thank you.

  6. kalpesh dhumal Avatar

    great tutorial….i like waht you are doing

  7. Sophie333C Avatar

    Hi Chris, great video yet again. I was wondering if you would do a follow up video showing how to save more than the password. cheers!

  8. Rumesh Hapuarachchi Avatar

    Hi, are there any similar library for Objective C, I see that this is only for swift. 🙁

  9. Jade Mulholland Avatar

    Great tutorial! Although, how would you save and load multiple credentials for the app?

  10. Juan Morillo Avatar

    Thanks Chris for tutorial!, great videos

  11. Doug Harper Avatar

    These Cocoapod videos are great. I can add pods in my sleep now.

  12. Cleverson Luiz Avatar

    Thanks Cris… I'm loving this videos showing some great libs… I would appreciate an tutorial on how upload video/photo with progress indicator… Thanks again and happy new year! Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *