---
title: "isSourceTypeAvailable(_:)"
framework: uikit
role: symbol
role_heading: Type Method
path: "uikit/uiimagepickercontroller/issourcetypeavailable(_:)"
---

# isSourceTypeAvailable(_:)

Queries whether the device supports picking media using the specified source type.

## Declaration

```swift
class func isSourceTypeAvailable(_ sourceType: UIImagePickerController.SourceType) -> Bool
```

## Parameters

- `sourceType`: The source to use to pick an image or movie.

## Return Value

Return Value true if the device supports the specified source type; false if the specified source type is not available.

## Discussion

Discussion Because a media source may not be present or may be unavailable, devices may not always support all source types. For example, if you attempt to pick an image from the user’s library and the library is empty, this method returns false. Similarly, if the camera is already in use, this method returns false. Before attempting to use an UIImagePickerController object to pick an image, you must call this method to ensure that the desired source type is available.

## See Also

### Setting the picker source

- [availableMediaTypes(for:)](uikit/uiimagepickercontroller/availablemediatypes(for:).md)
- [sourceType](uikit/uiimagepickercontroller/sourcetype-swift.property.md)
- [UIImagePickerController.SourceType](uikit/uiimagepickercontroller/sourcetype-swift.enum.md)
