# Installation

> UForm for Swift

```swift
dependencies: [
    .package(url: "https://github.com/unum-cloud/UForm", .upToNextMajor(from: "4.0.0"))
]
```

The package compiles the Swift surface only.
SwiftPM downloads the engine prebuilt, as the release's `UFormC` XCFramework on Apple platforms and as its artifact bundle on Linux, and the engine links the system codecs, libjpeg-turbo, libpng, libwebp and FFmpeg, which the application provides.
A checkout builds its own with CMake and points `UFORM_SWIFT_ARTIFACT` at it, relative to the package root:

```sh
cmake --preset swift
cmake --build --preset swift
UFORM_SWIFT_ARTIFACT=build_swift/UFormC.xcframework swift build # UFormC.artifactbundle off Apple platforms
```

The test suite runs in seconds against the stub library, which answers every verb with deterministic rows of the right shape:

```sh
cmake --preset swift -D UFORM_BUILD_STUB=ON
cmake --build --preset swift
UFORM_SWIFT_ARTIFACT=build_swift/UFormC.xcframework swift test # UFormC.artifactbundle off Apple platforms
```

`import UForm`

## version

The version of the linked library, like `4.0.0`.

```swift
func version() -> String
```

Calls `uform_version_name`.

