{"id":32109959,"url":"https://github.com/rvanmelle/quicksettings","last_synced_at":"2025-10-20T13:48:00.749Z","repository":{"id":64060301,"uuid":"72310935","full_name":"rvanmelle/QuickSettings","owner":"rvanmelle","description":"Build Lightweight In-app Settings screen quickly and easily","archived":false,"fork":false,"pushed_at":"2018-10-15T03:11:14.000Z","size":454,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T13:47:50.932Z","etag":null,"topics":["carthage","quicksettings","userdefaults"],"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/rvanmelle.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":"2016-10-29T21:40:33.000Z","updated_at":"2020-12-31T10:32:53.000Z","dependencies_parsed_at":"2023-01-14T20:30:45.698Z","dependency_job_id":null,"html_url":"https://github.com/rvanmelle/QuickSettings","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rvanmelle/QuickSettings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanmelle%2FQuickSettings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanmelle%2FQuickSettings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanmelle%2FQuickSettings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanmelle%2FQuickSettings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvanmelle","download_url":"https://codeload.github.com/rvanmelle/QuickSettings/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvanmelle%2FQuickSettings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280102710,"owners_count":26272390,"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","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["carthage","quicksettings","userdefaults"],"created_at":"2025-10-20T13:47:59.050Z","updated_at":"2025-10-20T13:48:00.743Z","avatar_url":"https://github.com/rvanmelle.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n# QuickSettings\n\nThe goal of this project is to build lightweight in-app settings screen quickly and easily. It is written in Swift3. Settings can be automatically persisted via UserDefaults.standard or sent to a custom datasource.\n\n## Disclaimers\n\nThis is a work in progress and should not be used in production. If you find this project useful or find it is missing a critical feature for your usage, please let me know and I'll do my best to add/improve based on your requests. \n\nIf you want some advanced, highly customizable, with validation, etc. you should use one of the many incredible open-source form options such as Eureka.\n\nThis project *will not* generate a proper settings bundle that can be used for your proper app settings.\n\n## Installation\n\nInstall via carthage by adding to your Cartfile:\n\n```\ngithub \"rvanmelle/QuickSettings\"\n```\n\n## ToDo\n\n* editable text cells\n  * basic formatting (phone numbers etc)\n  * some way to validate and show errors\n* stepper for integer values\n* slider for float values\n* inline group selection\n* usage from storyboard\n* unit tests\n\n## Usage\n\nDeclare your settings structure. You can use simple string enumerations for option sets. All settings should be given a default value which will be used if UserDefaults.standard does not have a value.\n\n```swift\nimport QuickSettings\n\nenum Dogs: String, QSDescriptionEnum {\n    case lady = \"Lady\"\n    case tramp = \"Tramp\"\n\n    var description: String? {\n        switch self {\n        case .lady: return \"He/she is dignified and proper.\"\n        case .tramp: return \"He/she is sassy and engaging.\"\n        }\n    }\n}\n\nenum Speed: String, QSDescriptionEnum {\n    case fast\n    case faster\n    case fastest\n    var description: String? {\n        switch self {\n        case .fastest: return \"A little faster than faster\"\n        default: return nil\n        }\n\n    }\n}\n\nlet settings: [QSSettable] = [\n    QSGroup(title: \"General\", children: [\n        QSToggle(label: \"Foo\", key: \"general.foo\", defaultValue: true),\n        QSInfo(label: \"Bar Info\", text: \"this is what bar is\"),\n        QSSelect(label: \"Bar2\", key: \"general.bar2\",\n                 options: QSEnumSettingsOptions\u003cDogs\u003e(defaultValue:.lady)),\n        QSText(label: \"Baz\", key: \"general.baz\", defaultValue: \"Saskatoon\"),\n        ], footer: \"This is a great section for adding lots of random settings that are not really necessary.\"),\n\n    QSText(label: \"Info\", key: \"general.info\", defaultValue: \"Swing\"),\n\n    QSGroup(title: \"Actions\", footer: nil, childrenCallback: { () -\u003e [QSSettable] in\n        let simpleAction = QSAction(title: \"Simple Action\", actionCallback: {\n            print(\"Simple Action\")\n        })\n        let destructiveAction = QSAction(title: \"Reset all data\", actionType: QSAction.ActionType.destructive, actionCallback: {\n            print(\"Delete all data\")\n        })\n        return [simpleAction, destructiveAction]\n    }),\n\n    QSSelect(label: \"How fast?\", key: \"speed\",\n             options:QSEnumSettingsOptions\u003cSpeed\u003e(defaultValue: .fastest)),\n\n    QSToggle(label: \"Should I?\", key: \"general.shouldi\", defaultValue: true),\n\n    QSGroup(title: \"Extra\", children: [\n        QSToggle(label: \"Foo\", key: \"extra.foo\", defaultValue: false),\n        QSToggle(label: \"Bar\", key: \"extra.bar\", defaultValue: true),\n        QSText(label: \"Baz\", key: \"extra.baz\", defaultValue: \"TomTom\"),\n\n        QSGroup(title: \"SubGroup\", children: [\n            QSToggle(label: \"SubFoo\", key: \"extra.subfoo\", defaultValue: false),\n            QSGroup(title: \"Text Fields\", children: [\n                QSText(label: \"Password\", key: \"extra.password\", placeholder: \"Enter password\", type: .password),\n                QSText(label: \"Email\", key: \"extra.email\", placeholder: \"Work email address\", type: .email),\n                QSText(label: \"Phone\", key: \"extra.phone\", defaultValue: nil, type: .phone),\n                QSText(label: \"URL\", key: \"extra.url\", defaultValue: nil, type: .url),\n                QSText(label: \"Decimal\", key: \"extra.decimal\", defaultValue: nil, type: .decimal),\n                QSText(label: \"Name\", key: \"extra.name\", defaultValue: nil, type: .name),\n                QSText(label: \"Int\", key: \"extra.int\", defaultValue: nil, type: .int)\n                ])\n            ], footer: \"This is a subgroup showing how the definition is recursive\")\n        ])\n]\n```\n\nCreate your root setting. This will be used to configure the base view controller for your settings hierarchy. At the highest level, the title will be the title for the root settings view controller, and the footer will be the table footer.\n\n```swift\nlet root = QSGroup(title:\"Settings Example\", children:settings, footer:\"This is a footer\")\n```\n\nIf you want to initialize your settings datastore with the declared default values OR reset all of your defaults back to defaults:\n\n```swift\nlet dataStore = UserDefaults.standard\nroot.initialize(datastore: dataStore)\nroot.reset(settings: settings, dataStore: dataStore)\n```\n\nTo use, simply declare a QSSettingsViewController, typically inside a navigation controller unless no hierarchy is required in your definition.\n\n```swift\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n\n        let dataStore = UserDefaults.standard\n        let root = QSGroup(title:\"Settings Example\", children:settings, footer:\"These are all of the settings at the top level\")\n        let vc = QSSettingsViewController(root: root, delegate: self, dataStore: dataStore)\n        let nav = UINavigationController(rootViewController: vc)\n        window?.rootViewController = nav\n        \n        return true\n    }\n```\n\nTo be notified of changes:\n\n```swift\nextension AppDelegate : QSSettingsViewControllerDelegate {\n    func settingsViewController(settingsVc: QSSettingsViewController, didUpdateSetting id: String) {\n        \n    }\n}\n```\n\n![Alt text](/screenshots/example1.png?raw=true \"Example 1\" | width=300)\n![Alt text](/screenshots/example2.png?raw=true \"Example 1\" | width=300)\n![Alt text](/screenshots/example3.png?raw=true \"Keyboards\" | width=300)\n\n## Using a Custom Data Store\n\nYou can pass in any datastore that conforms to the QSSettingsDataSource protocol:\n\n```swift\npublic protocol QSSettingsDataSource: class {\n\n    func hasValue(forKey: String) -\u003e Bool\n    func set(_ value: Any?, forKey defaultName: String)\n    func value\u003cT\u003e(forKey key: String, type: T.Type) -\u003e T?\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvanmelle%2Fquicksettings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvanmelle%2Fquicksettings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvanmelle%2Fquicksettings/lists"}