{"id":22192529,"url":"https://github.com/3sidedcube/userdefault","last_synced_at":"2025-06-14T00:04:57.131Z","repository":{"id":44938884,"uuid":"313368060","full_name":"3sidedcube/UserDefault","owner":"3sidedcube","description":"A simple property wrapper of the `UserDefaults`","archived":false,"fork":false,"pushed_at":"2023-07-31T14:30:17.000Z","size":36,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2025-03-24T20:45:38.914Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3sidedcube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-16T16:52:00.000Z","updated_at":"2022-01-01T20:22:03.000Z","dependencies_parsed_at":"2024-12-02T12:39:57.389Z","dependency_job_id":null,"html_url":"https://github.com/3sidedcube/UserDefault","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/3sidedcube/UserDefault","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FUserDefault","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FUserDefault/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FUserDefault/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FUserDefault/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3sidedcube","download_url":"https://codeload.github.com/3sidedcube/UserDefault/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2FUserDefault/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259737918,"owners_count":22903872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T12:25:50.890Z","updated_at":"2025-06-14T00:04:57.081Z","avatar_url":"https://github.com/3sidedcube.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UserDefault\nSimple property wrapper of the [UserDefaults](https://developer.apple.com/documentation/foundation/userdefaults).\n\n## Example\nUsing the `UserDefault` `@propertyWrapper` allows you to cleanly keep your `UserDefaults` logic all in one place. \nWhat you can persist is not limited to the supported types outlined in the [UserDefaults](https://developer.apple.com/documentation/foundation/userdefaults).\n`Codable` conformance is provided. For example:\n\n```swift\n/// A user model\nstruct User: Codable: UserDefaultsElement {\n    // ...\n}\n\n/// An animal model\nstruct Animal: Codable: UserDefaultsElement {\n\n    /// Default `Animal` to return from the `UserDefaults`\n    static var `default`: Animal {\n        // ...\n    }\n\n    // ...\n}\n\n/// Set of entities stored in the `UserDefaults`\nstruct UserDefaultValues {\n\n    /// Example of optional `Codable`\n    @UserDefault(\"user\", defaultValue: nil)\n    static var user: User?\n\n    /// Example of non-optional `Codable`\n    @UserDefault(\"animal\", defaultValue: .default)\n    static var animal: Animal\n\n    /// Example of `Int`\n    @UserDefault(\"age\", defaultValue: 18)\n    static var age: Int\n\n    /// Example of `Bool`\n    @UserDefault(\"isLoggedIn\", defaultValue: false)\n    static var isLoggedIn: Bool\n}\n``` \n\n## Acknowledgements\nhttps://www.avanderlee.com/swift/property-wrappers/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3sidedcube%2Fuserdefault","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3sidedcube%2Fuserdefault","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3sidedcube%2Fuserdefault/lists"}