---
title: "targets(ofType:)"
framework: swift-package-manager
role: symbol
role_heading: Instance Method
path: "swift-package-manager/documentation/packageplugin/package/targets(oftype:)"
---

# targets(ofType:)

The targets in this package that conform to a specific type.

## Declaration

```swift
func targets<T>(ofType: T.Type) -> [T] where T : Target
```

## See Also

### Inspecting Package Targets

- [targets](swift-package-manager/documentation/packageplugin/package/targets.md)
- [targets(named:)](swift-package-manager/documentation/packageplugin/package/targets(named:).md)
