{"id":32151323,"url":"https://github.com/loro-dev/loro-swift","last_synced_at":"2026-06-15T02:04:47.445Z","repository":{"id":252073202,"uuid":"838627691","full_name":"loro-dev/loro-swift","owner":"loro-dev","description":"Swift bindings of Loro CRDTs","archived":false,"fork":false,"pushed_at":"2026-06-14T09:00:54.000Z","size":22973,"stargazers_count":37,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-06-14T10:19:21.496Z","etag":null,"topics":["crdts","loro","loro-crdt","swift"],"latest_commit_sha":null,"homepage":"https://loro.dev","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/loro-dev.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-06T03:29:19.000Z","updated_at":"2026-06-14T09:00:35.000Z","dependencies_parsed_at":"2026-02-19T07:02:40.339Z","dependency_job_id":null,"html_url":"https://github.com/loro-dev/loro-swift","commit_stats":null,"previous_names":["loro-dev/loro-swift"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/loro-dev/loro-swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loro-dev%2Floro-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loro-dev%2Floro-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loro-dev%2Floro-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loro-dev%2Floro-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loro-dev","download_url":"https://codeload.github.com/loro-dev/loro-swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loro-dev%2Floro-swift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34344441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":["crdts","loro","loro-crdt","swift"],"created_at":"2025-10-21T10:41:27.025Z","updated_at":"2026-06-15T02:04:47.439Z","avatar_url":"https://github.com/loro-dev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Floro-dev%2Floro-swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/loro-dev/loro-swift)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Floro-dev%2Floro-swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/loro-dev/loro-swift)\n\n\u003ch1 align=\"center\"\u003eloro-swift\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca aria-label=\"X\" href=\"https://x.com/loro_dev\" target=\"_blank\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/badge/Twitter-black?style=for-the-badge\u0026logo=Twitter\"\u003e\n  \u003c/a\u003e\n  \u003ca aria-label=\"Discord-Link\" href=\"https://discord.gg/tUsBSVfqzf\" target=\"_blank\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/badge/Discord-black?style=for-the-badge\u0026logo=discord\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis repository contains experimental Swift bindings for\n[Loro CRDT](https://github.com/loro-dev/loro).\n\nIf you have any suggestions for API, please feel free to create an issue or join\nour [Discord](https://discord.gg/tUsBSVfqzf) community.\n\n\n## Usage\n\nAdd the dependency in your `Package.swift`.\n\n```swift\nlet package = Package(\n    name: \"your-project\",\n    products: [......],\n    dependencies:[\n        ...,\n        .package(url: \"https://github.com/loro-dev/loro-swift.git\", from: \"1.13.2\")\n    ],\n    targets:[\n        .executableTarget(\n            ...,\n            dependencies:[.product(name: \"Loro\", package: \"loro-swift\")],\n        )\n    ]\n)\n```\n\n## Examples\n\n```swift\nimport Loro\n\n// create a Loro document\nlet doc = LoroDoc()\n\n// create Root Container by getText, getList, getMap, getTree, getMovableList, getCounter\nlet text = doc.getText(id: \"text\")\n\ntry! text.insert(pos: 0, s: \"abc\")\ntry! text.delete(pos: 0, len: 1)\nlet s = text.toString()\n// XCTAssertEqual(s, \"bc\")\n\n// subscribe the event\nlet sub = doc.subscribeRoot{ diffEvent in\n    print(diffEvent)\n}\n\n// export updates or snapshot\nlet doc2 = LoroDoc()\nlet snapshot = doc.export(mode: ExportMode.snapshot)\nlet updates = doc.export(mode: ExportMode.updates(from: VersionVector()))\n\n// import updates or snapshot\nlet status = try! doc2.import(snapshot)\nlet status2 = try! doc2.import(updates)\n// import batch of updates or snapshot\ntry! doc2.importBatch(bytes: [snapshot, updates])\n\n// checkout to any version\nlet startFrontiers = doc.oplogFrontiers()\ntry! doc.checkout(frontiers: startFrontiers)\ndoc.checkoutToLatest()\n```\n\n## Develop\n\nIf you wanna build and develop this project with MacOS, you need first run this\nscript:\n\n```bash\nsh ./scripts/build_macos.sh\nLOCAL_BUILD=1 swift test\n```\n\nThe script will run `uniffi` and generate the `loroFFI.xcframework.zip`.\n\n# Credits\n- [uniffi-rs](https://github.com/mozilla/uniffi-rs): a multi-language bindings generator for rust\n- [Automerge-swift](https://github.com/automerge/automerge-swift): `loro-swift`\n    uses many of `automerge-swift`'s scripts for building and CI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floro-dev%2Floro-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floro-dev%2Floro-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floro-dev%2Floro-swift/lists"}