Structure

SupportedPlatform

A platform that the Swift package supports.

Declaration

struct SupportedPlatform

Overview

By default, the Swift Package Manager assigns a predefined minimum deployment version for each supported platforms unless you configure supported platforms using the platforms API. This predefined deployment version is the oldest deployment target version that the installed SDK supports for a given platform. One exception to this rule is macOS, for which the minimum deployment target version starts from 10.10. Packages can choose to configure the minimum deployment target version for a platform by using the APIs defined in this struct. The Swift Package Manager emits appropriate errors when an invalid value is provided for supported platforms, such as an empty array, multiple declarations for the same platform, or an invalid version specification.

The Swift Package Manager will emit an error if a dependency is not compatible with the top-level package’s deployment version. The deployment target of a package’s dependencies must be lower than or equal to the top-level package’s deployment target version for a particular platform.

Topics

Supporting iOS

static func iOS(SupportedPlatform.IOSVersion) -> SupportedPlatform

Configure the minimum deployment target version for the iOS platform.

static func iOS(String) -> SupportedPlatform

Configure the minimum deployment target version for the iOS platform using a custom version string.

static let iOS: Platform

The iOS platform.

struct SupportedPlatform.IOSVersion

The supported iOS version.

Supporting macOS

static func macOS(SupportedPlatform.MacOSVersion) -> SupportedPlatform

Configure the minimum deployment target version for the macOS platform.

static func macOS(String) -> SupportedPlatform

Configure the minimum deployment target version for the macOS platform using a version string.

static let macOS: Platform

The macOS platform.

struct SupportedPlatform.MacOSVersion

The supported macOS version.

Supporting watchOS

static func watchOS(SupportedPlatform.WatchOSVersion) -> SupportedPlatform

Configure the minimum deployment target version for the watchOS platform.

static func watchOS(String) -> SupportedPlatform

Configure the minimum deployment target version for the watchOS platform using a custom version string.

static let watchOS: Platform

The watchOS platform.

struct SupportedPlatform.WatchOSVersion

The supported watchOS version.

Supporting tvOS

static func tvOS(SupportedPlatform.TVOSVersion) -> SupportedPlatform

Configure the minimum deployment target version for the tvOS platform.

static func tvOS(String) -> SupportedPlatform

Configure the minimum deployment target version for the tvOS platform using a custom version string.

static let tvOS: Platform

The tvOS platform.

struct SupportedPlatform.TVOSVersion

The supported tvOS version.

Supporting Linux

static let linux: Platform

The Linux platform.

Relationships

Conforms To

See Also

Declaring Supported Platforms

struct Platform

A platform that usually corresponds to an operating system such as iOS, macOS, or Linux.