CameraViewControllerOptions
@available(iOS 9.0, *)
@objcMembers
@objc(PESDKCameraViewControllerOptions)
open class CameraViewControllerOptions : NSObject
Options for configuring a CameraViewController
.
-
The views background color. In video mode the colors alpha value is reduced to 0.3. Defaults to the global background color.
Declaration
Swift
public let backgroundColor: UIColor?
-
Use this closure to configure the cancel button.
Declaration
Swift
public let cancelButtonConfigurationClosure: ButtonConfigurationClosure?
-
Use this closure to configure the flash button.
Declaration
Swift
public let flashButtonConfigurationClosure: ButtonConfigurationClosure?
-
Use this closure to configure the switch camera button.
Declaration
Swift
public let switchCameraButtonConfigurationClosure: ButtonConfigurationClosure?
-
Use this closure to configure the camera roll button.
Declaration
Swift
public let cameraRollButtonConfigurationClosure: ButtonConfigurationClosure?
-
Use this closure to configure the action button in photo mode.
Declaration
Swift
public let photoActionButtonConfigurationClosure: ButtonConfigurationClosure?
-
Use this closure to configure the filter selector button.
Declaration
Swift
public let filterSelectorButtonConfigurationClosure: ButtonConfigurationClosure?
-
Use this closure to configure the timelabel.
Declaration
Swift
public let timeLabelConfigurationClosure: ((UILabel) -> Void)?
-
Use this closure to configure the filter intensity slider.
Declaration
Swift
public let filterIntensitySliderConfigurationClosure: ((Slider) -> Void)?
-
Use this closure to configure the given recording mode button. By default the buttons light up in yellow, when selected.
Declaration
Swift
public let recordingModeButtonConfigurationClosure: ((Button, RecordingMode) -> Void)?
-
Enable/Disable permanent crop to square. Disabled by default.
Declaration
Swift
public let cropToSquare: Bool
-
The maximum length of a video. If set to 0 the length is unlimited.
Declaration
Swift
public let maximumVideoLength: Int
-
Enable/Disable tap to focus on the camera preview image. Enabled by default.
Declaration
Swift
public let tapToFocusEnabled: Bool
-
Show/hide the cancel button. Disabled by default. In addition you have to set
CameraViewController.cancelBlock
and add custom code to dismiss your view controller when the user taps the cancel button.Declaration
Swift
public let showCancelButton: Bool
-
Show/Hide the camera roll button. Enabled by default.
Declaration
Swift
public let showCameraRoll: Bool
-
Enable/Disable filter bottom drawer. Enabled by default.
Declaration
Swift
public let showFilters: Bool
-
Enable/Disable filter intensity slider.
Declaration
Swift
public let showFilterIntensitySlider: Bool
-
The initial intensity of the filters.
Declaration
Swift
public let initialFilterIntensity: CGFloat
-
Allowed camera positions. Defaults to all available positions and falls back to supported position if only one exists.
Declaration
Swift
public let allowedCameraPositions: [AVCaptureDevice.Position]
-
Allowed flash modes. Defaults to all available modes. Duplicate values are not removed and may lead to unexpected behaviour. The first option is selected on launch, although the view controller tries to match the previous torch mode on record mode changes.
Declaration
Swift
public let allowedFlashModes: [AVCaptureDevice.FlashMode]
-
Allowed torch modes. Defaults to all available modes. Duplicate values are not removed and may lead to unexpected behaviour. The first option is selected on launch, although the view controller tries to match the previous flash mode on record mode changes.
Declaration
Swift
public let allowedTorchModes: [AVCaptureDevice.TorchMode]
-
Supported recording modes (e.g. .Photo or .Video). Defaults to all available modes. Duplicate values are not removed and may lead to unexpected behaviour. The first option is selected on launch.
Declaration
Swift
public let allowedRecordingModes: [RecordingMode]
-
The video output settings to use for video recording. If
nil
, the recommended video settings for file typeAVFileTypeQuickTimeMovie
will be used.Declaration
Swift
public let videoOutputSettings: [String : AnyObject]?
-
The video output settings to use for video recording. If
nil
, the recommended audio settings for file typeAVFileTypeQuickTimeMovie
will be used.Declaration
Swift
public let audioOutputSettings: [String : AnyObject]?
-
The file type to use for video recording. Default is
AVFileTypeQuickTimeMovie
.Note
If you change this, you will most likely also want to changevideoOutputSettings
andaudioOutputSettings
.Declaration
Swift
public let videoRecordingFileType: AVFileType
-
The extension to use for video files. Default is “mov”.
Declaration
Swift
public let videoRecordingFileExtension: String
-
Use this closure to further configure the asset writer that is created for video recording.
Declaration
Swift
public let assetWriterConfigurationClosure: ((AVAssetWriter) -> Void)?
-
Whether the user’s location should be included in photos. This is enabled by default.
Attention
When this is set totrue
, you must either request location access within your host app or setCameraViewController.locationAccessRequestClosure
.Declaration
Swift
public let includeUserLocation: Bool
-
Whether the recorded video should include the applied filter or not. This is disabled by default.
Declaration
Swift
public let writeVideoWithFilterApplied: Bool