---
title: "when(platforms:)"
framework: packagedescription
role: symbol
role_heading: Type Method
path: "packagedescription/targetdependencycondition/when(platforms:)-5bxhc"
---

# when(platforms:)

Creates a target dependency condition.

## Declaration

```swift
static func when(platforms: [Platform]) -> TargetDependencyCondition?
```

## Parameters

- `platforms`: The applicable platforms for this target dependency condition.

## See Also

### Creating a Dependency Condition

- [when(traits:)](packagedescription/targetdependencycondition/when(traits:).md)
- [when(platforms:traits:)](packagedescription/targetdependencycondition/when(platforms:traits:).md)
- [when(platforms:)](packagedescription/targetdependencycondition/when(platforms:)-4djh6.md)
