Swift language bindings to Y-CRDT

What's New

Initial YSwift release (0.1.0)


The 0.1.0 release of YSwift is an initial functional, but limited, version of the Swift language bindings over Yrs.

Built from the 0.1.0 roadmap issue, this release includes support for:

  • Document
  • Transaction
  • Text
  • Array
  • Map
  • Observations
  • Basic Thread-safety
  • Idiomatic API (Conformance to native protocols, "Swifty" feel & etc)
  • Examples
  • Basic docs for library consumers

Embeds and Attributes for text are supported, but not exposed in examples and only available through observation results of changes. More complete Yrs support including nested CRDT types, XML types, Undo/Redo Manager, Awareness protocol, and more are for future development.


This library builds on top of Yrs to provide Swift language bindings that seamlessly interoperate with other Yjs implementations.

This repository is WIP (Work In Progress) Not all features and capabilities from Yrs or Yjs are exposed at this time. We plan to add them as the library evolves.

The repository includes two swift packages:

yniffiFFI a static binary packaged as an XCFramework in the lib directory, built with the Rust compiler and overlaid using UniFFI. YSwift which is an overlay to provide more idiomatic Swift language operations.

To build the package from source, you need both Rust and XCode installed. The GitHub releases should include versioned links to the yniffiFFI. Development releases expect that you will build you own local copy using ./scripts/build-xcframework.sh.

Decision log

This project maintains a decision log. Please consult it in case there is some ambiguity in terms of why certain implementation details look as they are.


This project is available as open source under the terms of the MIT License.

Thanks to

Amazing people at Mozilla for their outsanding work on UniFFI and all of the supporting work they've done on using, packaging and distributing Rust code for Swift and Kotlin codebases.


  • Swift Tools 5.6.0
View More Packages from this Author


Last updated: Fri Mar 01 2024 09:57:07 GMT-1000 (Hawaii-Aleutian Standard Time)