{"id":24810785,"url":"https://github.com/yusukehosonuma/userdefaultsbrowser","last_synced_at":"2025-06-26T09:36:02.905Z","repository":{"id":40272047,"uuid":"489245513","full_name":"YusukeHosonuma/UserDefaultsBrowser","owner":"YusukeHosonuma","description":"🔍 Browse and edit UserDefaults on your app","archived":false,"fork":false,"pushed_at":"2022-11-13T07:20:29.000Z","size":163,"stargazers_count":28,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-09-11T05:50:19.417Z","etag":null,"topics":["ios-app","swift","swiftui","userdefaults"],"latest_commit_sha":null,"homepage":"https://qiita.com/YusukeHosonuma/items/4051daa8b0de2e9d2552","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/YusukeHosonuma.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}},"created_at":"2022-05-06T06:42:34.000Z","updated_at":"2023-08-22T02:32:14.000Z","dependencies_parsed_at":"2022-07-24T18:02:38.506Z","dependency_job_id":null,"html_url":"https://github.com/YusukeHosonuma/UserDefaultsBrowser","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YusukeHosonuma%2FUserDefaultsBrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YusukeHosonuma%2FUserDefaultsBrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YusukeHosonuma%2FUserDefaultsBrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YusukeHosonuma%2FUserDefaultsBrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YusukeHosonuma","download_url":"https://codeload.github.com/YusukeHosonuma/UserDefaultsBrowser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236345657,"owners_count":19134306,"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":["ios-app","swift","swiftui","userdefaults"],"created_at":"2025-01-30T12:18:03.439Z","updated_at":"2025-01-30T12:18:03.962Z","avatar_url":"https://github.com/YusukeHosonuma.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UserDefaults-Browser\n\nBrowse and edit [UserDefaults](https://developer.apple.com/documentation/foundation/userdefaults) on your app. (SwiftUI or UIKit)\n\n| Browse | Edit (as JSON) | Edit (Date) | Export |\n| -- | -- | -- | -- |\n|\u003cimg width=\"415\" alt=\"image\" src=\"https://user-images.githubusercontent.com/2990285/167282478-3d4c17bf-40fd-47fd-bc1e-647002f9b7dc.png\"\u003e|\u003cimg width=\"415\" alt=\"image\" src=\"https://user-images.githubusercontent.com/2990285/167282487-da0de277-917e-4032-8f7d-b027c0ea1690.png\"\u003e|\u003cimg width=\"415\" alt=\"image\" src=\"https://user-images.githubusercontent.com/2990285/167282490-0281e64a-9b9f-44e7-bfea-f9f27772aeae.png\"\u003e|\u003cimg width=\"415\" alt=\"image\" src=\"https://user-images.githubusercontent.com/2990285/167282492-034ccd01-742b-49b6-ab65-7492ebc34984.png\"\u003e|\n\n\n**Note:**\n\nWe recommend to use [SwiftUI-Simulator](https://github.com/YusukeHosonuma/SwiftUI-Simulator), if you use it in an app built with SwiftUI.\u003cbr\u003e\n(This feature is also included)\n\n## Supported Types\n\n- [Property List Types](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/PropertyList.html)\n  - [x] `Array`\n  - [x] `Dictionary`\n  - [x] `String`\n  - [x] `Date`\n  - [x] `Int`\n  - [x] `Float`\n  - [x] `Double`\n  - [x] `Bool`\n- Other\n  - [x] `URL`\n  - [x] `UIImage` (Read-only)\n- JSON encoded\n  - [x] `Data`\n  - [x] `String`\n\n[AppGroups](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_application-groups) (`UserDefaults(suiteName: \"group.xxx\")`) is also supported, please see [Configurations](#Configurations).\n\n## Quick Start\n\n1. Add `https://github.com/YusukeHosonuma/UserDefaultsBrowser` in the Xcode or `Package.swift`:\n\n```swift\nlet package = Package(\n    dependencies: [\n        .package(url: \"https://github.com/YusukeHosonuma/UserDefaultsBrowser\", from: \"1.0.0\"),\n    ],\n    targets: [\n        .target(name: \"\u003cyour-target-name\u003e\", dependencies: [\n             \"UserDefaultsBrowser\",\n        ]),\n    ]\n)\n```\n\n2. Setup launcher button.\n\n**SwiftUI:** Surround the root view with `UserDefaultsBrowserContainer`.\n\n```swift\nimport UserDefaultsBrowser\n\n@main\nstruct ExampleApp: App {\n    var body: some Scene {\n        WindowGroup {\n            UserDefaultsBrowserContainer {\n                ContentView() // 💡 Your root view.\n            }\n        }\n    }\n}\n```\n\n**UIKit:** Call `setupUserDefaultsBrowserLauncher` in `viewDidLoad` of your root ViewController.\n\n```swift\nimport UserDefaultsBrowser\n\nclass ViewController: UIViewController { // 💡 Your root ViewController.\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        UserDefaultsBrowser.setupUserDefaultsBrowserLauncher()\n    }\n}\n```\n\n3. Tap launcher button at leading bottom.\n\n![image](https://user-images.githubusercontent.com/2990285/167282686-e53f6621-d6d5-47bb-9f77-e62de33a41f3.png)\n\n## Configuration\n\nBoth SwiftUI and UIKit have the same options like follows.\n\n```swift\nUserDefaultsBrowserContainer(\n    suiteNames: [\"group.xxx\"],                        // AppGroups IDs\n    excludeKeys: { $0.hasPrefix(\"not-display-key\") }, // Exclude keys\n    accentColor: .orange,                             // Your favorite color (`UIColor` type in UIKit-based API)\n    imageName: \"wrench.and.screwdriver\",              // SFSymbols name\n    displayStyle: .fullScreen                         // `.sheet` or `.fullScreen`\n)\n```\n\n## Add to some View or ViewController\n\nFor example, for tab-based applications, it is useful to have a tab for browsing.\n\n### SwiftUI\n\n```swift\nvar body: some View {\n    TabView {\n        ...\n        UserDefaultsBrowserView()\n            .tabItem {\n                Label(\"Browser\", systemImage: \"externaldrive\")\n            }\n    }\n}\n```\n\n### UIKit\n\n```swift\nclass TabItemViewController: UIViewController {\n    override func viewDidLoad() {\n        let vc = UserDefaultsBrowserViewController()\n        addChild(vc)\n        view.addSubview(vc.view)\n        vc.didMove(toParent: self)\n        \n        vc.view.translatesAutoresizingMaskIntoConstraints = false\n        vc.view.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0).isActive = true\n        vc.view.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 0).isActive = true\n        vc.view.topAnchor.constraint(equalTo: view.topAnchor, constant: 0).isActive = true\n        vc.view.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0).isActive = true\n    }\n}\n```\n\n## Requirements\n\n- iOS 14+\n\n## Contributions\n\nIssues and PRs are welcome, even for minor improvements and corrections.\n\n## Author\n\nYusuke Hosonuma / [@tobi462](https://twitter.com/tobi462)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukehosonuma%2Fuserdefaultsbrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusukehosonuma%2Fuserdefaultsbrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukehosonuma%2Fuserdefaultsbrowser/lists"}