{"id":1854,"url":"https://github.com/bradhilton/SwiftKVC","last_synced_at":"2025-08-02T05:32:48.578Z","repository":{"id":62456546,"uuid":"41694119","full_name":"bradhilton/SwiftKVC","owner":"bradhilton","description":"Key-Value Coding (KVC) for native Swift classes and structs","archived":false,"fork":false,"pushed_at":"2018-04-06T15:44:11.000Z","size":71,"stargazers_count":135,"open_issues_count":3,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-01T11:53:14.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/bradhilton.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":"2015-08-31T18:51:48.000Z","updated_at":"2024-10-27T09:42:27.000Z","dependencies_parsed_at":"2022-11-02T00:17:06.040Z","dependency_job_id":null,"html_url":"https://github.com/bradhilton/SwiftKVC","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bradhilton/SwiftKVC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradhilton%2FSwiftKVC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradhilton%2FSwiftKVC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradhilton%2FSwiftKVC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradhilton%2FSwiftKVC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradhilton","download_url":"https://codeload.github.com/bradhilton/SwiftKVC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradhilton%2FSwiftKVC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268339403,"owners_count":24234544,"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-08-02T02:00:12.353Z","response_time":74,"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":[],"created_at":"2024-01-05T20:15:57.356Z","updated_at":"2025-08-02T05:32:48.244Z","avatar_url":"https://github.com/bradhilton.png","language":"Swift","funding_links":[],"categories":["Reflection","Libs","Misc","Utilities and Extensions"],"sub_categories":["React-Like","Other free courses","Key Value Coding"],"readme":"# SwiftKVC\n\n`SwiftKVC` brings key-value coding to native Swift classes and structures. You can easily set and access properties just using a subscript:\n```swift\nvar person = Person()\nperson[\"name\"] = \"John\"\n```\nOr use the more verbose method to catch potential errors:\n```swift\nvar person = Person()\ndo {\n  try person.set(value: \"John\", key: \"name\")\n} catch {\n  print(error)\n}\n```\n`SwiftKVC` brings the power of Cocoa style key-value coding to Swift.\n\n## Installation\n\n`SwiftKVC` is available through [CocoaPods](http://cocoapods.org). To install, simply include the following lines in your podfile:\n```ruby\nuse_frameworks!\npod 'SwiftKVC'\n```\nBe sure to import the module at the top of your .swift files:\n```swift\nimport SwiftKVC\n```\nAlternatively, clone this repo or download it as a zip and include the classes in your project.\n\n## Usage\n\nTo enable key-value coding for a native Swift structure or class, simply have it conform to either `Value` or `Object` respectively:\n```swift\nstruct Person : Value {\n  var name: String\n  var age: Int\n}\n```\nYou can then set and retrieve values from your model by key:\n```swift\nperson[\"name\"] = \"John\"\nperson[\"age\"] = 36\nif let id = person[\"id\"] as? Int {\n  print(id)\n}\n```\nIf you would like to handle possible errors, you can use the more verbose methods:\n```swift\ndo {\n  try person.set(value: \"John\", key: \"name\")\n  try person.set(value: 36, key: \"age\")\n  if let id = try person.get(key: \"id\") as? Int {\n    print(id)\n  }\n} catch {\n  print(error)\n}\n```\n## Author\n\nBrad Hilton, brad@skyvive.com\n\n## License\n\n`SwiftKVC` is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradhilton%2FSwiftKVC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradhilton%2FSwiftKVC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradhilton%2FSwiftKVC/lists"}