<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "swift: 5.9.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftData",
  "identifier" : "/documentation/SwiftData/Schema/Version-swift.struct/init(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftData"
    ],
    "preciseIdentifier" : "s:9SwiftData6SchemaC7VersionVyAESi_S2itcfc"
  },
  "title" : "init(_:_:_:)"
}
-->

# init(_:_:_:)

Initializes a version struct with the provided components of a semantic version.

```
init(_ major: Int, _ minor: Int, _ patch: Int)
```

## Parameters

`major`

The major version number.

`minor`

The minor version number.

`patch`

The patch version number.

## Discussion> Precondition: `major >= 0 && minor >= 0 && patch >= 0`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)