{"id":17686589,"url":"https://github.com/vinhnx/dictionarynestedsubscript","last_synced_at":"2025-08-24T13:36:18.638Z","repository":{"id":63921226,"uuid":"191301868","full_name":"vinhnx/DictionaryNestedSubscript","owner":"vinhnx","description":"Nested subscript for Dictionary.","archived":false,"fork":false,"pushed_at":"2020-04-17T13:45:49.000Z","size":113,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T08:03:54.252Z","etag":null,"topics":["demo","github-package-registry","smile","swift","swift-package-manager","swiftpm","xcode"],"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/vinhnx.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":"2019-06-11T05:43:12.000Z","updated_at":"2021-01-30T00:41:53.000Z","dependencies_parsed_at":"2023-01-14T14:15:33.646Z","dependency_job_id":null,"html_url":"https://github.com/vinhnx/DictionaryNestedSubscript","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinhnx%2FDictionaryNestedSubscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinhnx%2FDictionaryNestedSubscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinhnx%2FDictionaryNestedSubscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinhnx%2FDictionaryNestedSubscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinhnx","download_url":"https://codeload.github.com/vinhnx/DictionaryNestedSubscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850368,"owners_count":21973661,"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":["demo","github-package-registry","smile","swift","swift-package-manager","swiftpm","xcode"],"created_at":"2024-10-24T10:45:20.202Z","updated_at":"2025-05-13T00:34:29.366Z","avatar_url":"https://github.com/vinhnx.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DictionaryNestedSubscript\n\nA Swift Package that enable nested `subscript` on `Dictionary`.\n\n### Usage\n\n```swift\nimport DictionaryNestedSubscript\n\nlet dictionary: [String: Any] = [\n    \"countries\": [\n        \"japan\": [\n            \"capital\": [\n                \"name\": \"tokyo\",\n                \"lat\": \"35.6895\",\n                \"lon\": \"139.6917\"\n            ],\n            \"language\": \"japanese\"\n        ]\n    ]\n]\n\ndictionary[jsonDict: \"countries\"]?[jsonDict: \"japan\"]?[jsonDict: \"capital\"]?[\"name\"] // \"tokyo\"\n```\n\n### Integration (requires Xcode 11+)\n\n1. from your project, Choose `Xcode \u003e File \u003e Swift Packages \u003e Add Package Dependency...`\n\n![demo](./screenshot/step_1.png)\n\n2. put `https://github.com/vinhnx/DictionaryNestedSubscript` under `Choose Package Repository` field\n\n![demo](./screenshot/step_2.png)\n\n3. (optional) specify the version or branch or specific commit you want to use from the package\n\n![demo](./screenshot/step_3.png)\n\n4. then click `Next` for Xcode to resolve the package.\n\n![demo](./screenshot/step_4.png)\n\n5. Choose where to add Package framework to your app's target\n\n![demo](./screenshot/step_5.png)\n\n6. Profit :smile:\n\n![demo](./screenshot/step_6.png)\n\n### References\n\nGuide\n\n+ https://developer.apple.com/documentation/swift_packages/creating_a_swift_package_with_xcode\n+ https://developer.apple.com/documentation/swift_packages/publishing_a_swift_package_with_xcode\n\nInspiration\n\n+ https://github.com/krzyzanowskim/CollectionSafeIndex (for the idea :smile:)\n+ https://stackoverflow.com/a/41543070/1477298 (for the logic :rocket:)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinhnx%2Fdictionarynestedsubscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinhnx%2Fdictionarynestedsubscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinhnx%2Fdictionarynestedsubscript/lists"}