Build a Secure SwiftUI Property Wrapper for the Keychain

Securely save data for any Codable type in the encrypted database of your iOS and macOS apps

Millie Dev
Better Programming
Published in
5 min readJan 22, 2021

--

Keys on keychain
Photo by Uwe Baumann on Pixabay.

When you want a property to be saved and loaded from the persistent storage called UserDefaults, you can declare it like this:

@AppStorage(“MyKey”) var savedValue

--

--

An iOS developer who writes about gadgets, startups and blockchains. Swift programming tutorials are at typesafely.co.Uk