# UserDefaults

Overview

## Sample Projects

{% embed url="<https://github.com/Huss3n/ToDo-App?ref=iosexample.com>" %}

## Sample Codes

Delete UserDefaults on MacOS

<pre class="language-swift"><code class="lang-swift"><strong>defaults delete your.app.bundle.id
</strong></code></pre>

## Subjects

### Saving and Loading Data

{% embed url="<https://youtu.be/DECUCFiCJ-M>" %}
[Hacking with Swift / 100 Days / Day-84 - Saving and loading data with UserDefaults](https://www.hackingwithswift.com/books/ios-swiftui/saving-and-loading-data-with-userdefaults)
{% endembed %}

## Sources

### Videos

{% embed url="<https://youtu.be/nGmrtPNuE2Q>" %}
[Hacking with Swift / 100 Days / Day-36 - Storing user settings with UserDefaults](https://www.hackingwithswift.com/books/ios-swiftui/storing-user-settings-with-userdefaults)
{% endembed %}

...

{% embed url="<https://youtu.be/QyASq6sgTmo>" %}
[Hacking with Swift / 100 Days / Day-37 - Making changes permanent with UserDefaults](https://www.hackingwithswift.com/books/ios-swiftui/making-changes-permanent-with-userdefaults)
{% endembed %}

**Tags**: [Codable](/codes/main-pillars-protocol-class-struct-etc./protocols/codable.md),&#x20;

...

### Articles / Documents

*

## See also

*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://swift.sedatonat.dev/databases/apple-database/userdefaults.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
