{"id":23009755,"url":"https://github.com/juniperphoton/photonmacros","last_synced_at":"2025-07-11T14:37:02.975Z","repository":{"id":199212433,"uuid":"702363605","full_name":"JuniperPhoton/PhotonMacros","owner":"JuniperPhoton","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-24T14:07:14.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T16:14:15.138Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuniperPhoton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-10-09T07:18:04.000Z","updated_at":"2023-10-09T08:26:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"42359cb0-5cc9-4918-8bbe-718018f39439","html_url":"https://github.com/JuniperPhoton/PhotonMacros","commit_stats":null,"previous_names":["juniperphoton/photonmacros"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/JuniperPhoton/PhotonMacros","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FPhotonMacros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FPhotonMacros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FPhotonMacros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FPhotonMacros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuniperPhoton","download_url":"https://codeload.github.com/JuniperPhoton/PhotonMacros/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuniperPhoton%2FPhotonMacros/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264833290,"owners_count":23670617,"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-15T09:15:29.027Z","updated_at":"2025-07-11T14:37:02.944Z","avatar_url":"https://github.com/JuniperPhoton.png","language":"Swift","readme":"# PhotonMacros\n\nProvides some useful macros to use in iOS/macOS development.\n\n## UserDefaultsAccess\n\nThis is an attached macro to generate the get/set access to the provided user default. Currently supports types of `Bool`, `Integer` and `String`.\n\nThe signature of this macro is:\n```swift\npublic macro UserDefaultsAccess\u003cT\u003e(defaultValue: T, key: String? = nil, store: UserDefaults = UserDefaults.standard)\n```\n\nThere are 3 parameters you should provide:\n- `defaultValue`: If the specified key doesn't exist in the `UserDefaults`, the default value will be returned in the get method.\n- `key`: The key string to access the `UserDefaults`. This can be nil if the key value is the same as the property name.\n- `store`: The instance of `UserDefaults`. The default value is `.standard`.\n\nUsage:\n\n```swift\n@UserDefaultsAccess(defaultValue: false, store: AppSettings.getSharedUserDefault())\nvar sortByAscending: Bool\n```\n\nThis expansion of the code above is:\n\n```swift\nvar sortByAscending: Bool {\n    get {\n        if AppSettings.getSharedUserDefault().value(forKey: \"sortByAscending\") == nil {\n            return false\n        }\n        return AppSettings.getSharedUserDefault().bool(forKey: \"sortByAscending\")\n    }\n    set {\n        AppSettings.getSharedUserDefault().setValue(newValue, forKey: \"sortByAscending\")\n    }\n}\n```\n\n# MIT License\n\nCopyright (c) [2023] [JuniperPhoton]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniperphoton%2Fphotonmacros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuniperphoton%2Fphotonmacros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniperphoton%2Fphotonmacros/lists"}