# Friday Q&A 2017-10-06: Type-Safe User Defaults

DevFeed: [Friday Q&A 2017-10-06: Type-Safe User Defaults](<https://devfeed.tech/articles/friday-q-a-2017-10-06-type-safe-user-defaults-30623.md>)

Original publisher: [Read original article](<http://www.mikeash.com/pyblog/friday-qa-2017-10-06-type-safe-user-defaults.html>)

Author: Mike Ash

Published: 2017-10-06T12:55:00Z

Content type: tutorial

Language: en

Sources: [Mike Ash](<https://devfeed.tech/sources/mike-ash.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Library](<https://devfeed.tech/topics/library.md>), [API](<https://devfeed.tech/topics/api.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>), [Vapor](<https://devfeed.tech/topics/swift-vapor.md>)

Tags: [2017](<https://devfeed.tech/tags/2017.md>), [api](<https://devfeed.tech/tags/api.md>), [article](<https://devfeed.tech/tags/article.md>), [code](<https://devfeed.tech/tags/code.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [swift](<https://devfeed.tech/tags/swift.md>)

## AI overview

This tutorial presents a type-safe Swift layer over NSUserDefaults. It describes typed keys, automatic key naming, default values, optional values, and conversion handled internally, with implementation examples.

## Source excerpt

It's fun to re-imagine traditional techniques with a Swift twist. I've implemented a type-safe layer on top of the venerable NSUserDefaults, and I'm going to discuss my little library today. Credit/blame for this idea goes to local reader José Vazquez, although he inspired it by accident while talking about something else. (Read More)