Instance Property

sourceType

The type of picker interface to be displayed by the controller.

Declaration

var sourceType: UIImagePickerController.SourceType { get set }

Discussion

Prior to running the picker interface, set this value to the desired source type. The source type you set must be available and an exception is thrown if it is not. If you change this property while the picker is visible, the picker interface changes to match the new value in this property.

The various source types are listed in the UIImagePickerController.SourceType enumeration. The default value is UIImagePickerController.SourceType.photoLibrary.

See Also

Setting the Picker Source

class func availableMediaTypes(for: UIImagePickerController.SourceType) -> [String]?

Returns an array of the available media types for the specified source type.

class func isSourceTypeAvailable(UIImagePickerController.SourceType) -> Bool

Returns a Boolean value indicating whether the device supports picking media using the specified source type.

enum UIImagePickerController.SourceType

The source to use when picking an image or when determining available media types.