Skip to content

Commit

Permalink
[docs] detail how to add Automerge-swift as a dependency (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
heckj authored Oct 20, 2023
1 parent 8057ee3 commit af81c3e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/automerge/automerge-swift.git", from: "0.1.1")
.package(url: "https://github.com/automerge/automerge-swift.git", from: "0.5.2")
],
targets: [
.executableTarget(
Expand Down
24 changes: 24 additions & 0 deletions Sources/Automerge/Automerge.docc/FiveMinuteQuickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ struct ColorList: Codable {

See <doc:ModelingData> for more details on the types that Automerge stores and how the library exposes those types in Swift.

### Add Automerge-swift as a dependency

If you're working with a Swift package, add Automerge-swift as a dependency to Package.swift:

```swift
let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/automerge/automerge-swift.git", from: "0.5.2")
],
targets: [
.executableTarget(
...
dependencies: [.product(name: "Automerge", package: "automerge-swift")],
...
)
]
)
```

If you're working with an Xcode project, search for the swift package using the repository URL
`github.com/automerge/automerge-swift` to add it as a dependency to iOS, macOS, or macCatalyst targets.

### Creating a Document

The following example creates a new Automerge ``Document`` instance and uses ``AutomergeEncoder`` to store an instance of the `ColorList` model into it:
Expand Down

0 comments on commit af81c3e

Please sign in to comment.