From the course: Advanced iOS Development: Keychain Access

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Add notes to keychain

Solution: Add notes to keychain - iOS Tutorial

From the course: Advanced iOS Development: Keychain Access

Start my 1-month free trial

Solution: Add notes to keychain

(techno music) - [Instructor] I hope you did good on that challenge. I hope you learned something and had fun with it. It's a little bit different, but similar to what we've been doing before, so let's go over it. So here's where we create the new note, so this is where I want to add it to the keychain. So I'm going to go to secure manager and write a function for that. So down at the bottom after line 94, but inside the secure manager class, I'm going to start a new function, static func storeItem. You can call this storeNote. I'm trying to keep it a little bit more generic. And then we're going to pass in a uuid. That's a string. And then text. That's a string. That'll be the text of the note. And then I'm going to return Bool like we've done before. So what we have to do here is convert our text to data and then add it to the keychain very much like we did here in the storeLogin. So I'm going to copy this code…

Contents