{"id":18259083,"url":"https://github.com/ddddxxx/swiftcf","last_synced_at":"2025-10-08T00:48:13.224Z","repository":{"id":82452669,"uuid":"204712092","full_name":"ddddxxx/SwiftCF","owner":"ddddxxx","description":"Use CoreFoundation based framework in Swift painlessly.","archived":false,"fork":false,"pushed_at":"2021-05-27T12:20:42.000Z","size":378,"stargazers_count":18,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T19:32:59.784Z","etag":null,"topics":["corefoundation","coregraphics","coretext","imageio","iokit"],"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/ddddxxx.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-27T13:43:22.000Z","updated_at":"2024-08-25T16:35:13.000Z","dependencies_parsed_at":"2023-06-15T18:15:53.703Z","dependency_job_id":null,"html_url":"https://github.com/ddddxxx/SwiftCF","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/ddddxxx/SwiftCF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddddxxx%2FSwiftCF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddddxxx%2FSwiftCF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddddxxx%2FSwiftCF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddddxxx%2FSwiftCF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddddxxx","download_url":"https://codeload.github.com/ddddxxx/SwiftCF/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddddxxx%2FSwiftCF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278872155,"owners_count":26060525,"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-07T02:00:06.786Z","response_time":59,"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":["corefoundation","coregraphics","coretext","imageio","iokit"],"created_at":"2024-11-05T10:36:15.919Z","updated_at":"2025-10-08T00:48:13.218Z","avatar_url":"https://github.com/ddddxxx.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftCF\n\n[![Github CI Status](https://github.com/ddddxxx/SwiftCF/workflows/CI/badge.svg)](https://github.com/ddddxxx/SwiftCF/actions)\n\nUsing CoreFoundation based framework in Swift painlessly.\n\nWrapped frameworks:\n\n- [x] CoreFoundation\n- [x] CoreGraphics\n- [x] CoreText\n- [x] ImageIO\n- [x] IOKit\n    - [x] HID\n- [x] ApplicationServices\n    - [x] Accessibility (`AXUIElement`)\n- [ ] CoreMedia\n- [ ] CoreVideo\n- [ ] CFNetwork\n- [ ] Security\n- [ ] CoreServices\n- [ ] VideoToolbox\n- [ ] SystemConfiguration\n\n## Usage\n\n### Dynamic casting to CoreFoundation types via the type-id mechanism.\n\n```swift\nimport SwiftCF\n\nlet str: Any = \"foo\" as CFString\n\nlet s0 = str as? CFString\n// ❗️ Conditional downcast to CoreFoundation type 'CFString' will always succeed\n\nlet s1: CFString = cfCast(str) // or\nlet s2 = cfCast(str, to: CFString.self) // or\nlet s3 = CFString.cast(str)\n// ✅\n```\n\n### Toll-Free-Bridging\n\n```swift\nlet cfStr: CFString = .from(\"foo\")\nlet nsStr: NSString = cfStr.asNS()\nlet str: String = cfStr.asSwift()\n```\n\n### Convenient Extensions\n\n```swift\nlet str = \"foo\" as CFString\n\nstr.length\n// Replace CFStringGetLength(str)\n\nCFStringTokenizer.create(string: str)\n// Replace 😱 CFStringTokenizerCreate(kCFAllocatorDefault, str, CFRange(location: 0, length: CFStringGetLength(str)), kCFStringTokenizerUnitWord, CFLocaleGetSystem())\n```\n\n### Swift Protocol Conformance\n\n```swift\nlet arr = [1, 3.14, \"foo\"] as CFArray\n\nfor item in arr {\n    // 😃 CFArray now conforms to RandomAccessCollection.\n}\n```\n\n## Requirements\n\n- Swift 5.0+\n\n## License\n\nSwiftCF is available under the MIT license. See the [LICENSE file](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddddxxx%2Fswiftcf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddddxxx%2Fswiftcf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddddxxx%2Fswiftcf/lists"}