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

    open let backgroundColor: UIColor?
  • Use this closure to configure the cancel button.

    Declaration

    Swift

    open let cancelButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the flash button.

    Declaration

    Swift

    open let flashButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the switch camera button.

    Declaration

    Swift

    open let switchCameraButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the camera roll button.

    Declaration

    Swift

    open let cameraRollButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the action button in photo mode.

    Declaration

    Swift

    open let photoActionButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the filter selector button.

    Declaration

    Swift

    open let filterSelectorButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the timelabel.

    Declaration

    Swift

    open let timeLabelConfigurationClosure: ((UILabel) -> Void)?
  • Use this closure to configure the filter intensity slider.

    Declaration

    Swift

    open 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

    open let recordingModeButtonConfigurationClosure: ((Button, RecordingMode) -> Void)?
  • Enable/Disable permanent crop to square. Disabled by default.

    Declaration

    Swift

    open let cropToSquare: Bool
  • The maximum length of a video. If set to 0 the length is unlimited.

    Declaration

    Swift

    open let maximumVideoLength: Int
  • Enable/Disable tap to focus on the camera preview image. Enabled by default.

    Declaration

    Swift

    open let tapToFocusEnabled: Bool
  • Show/hide the cancel button. Disabled by default.

    Declaration

    Swift

    open let showCancelButton: Bool
  • Show/Hide the camera roll button. Enabled by default.

    Declaration

    Swift

    open let showCameraRoll: Bool
  • Enable/Disable filter bottom drawer. Enabled by default.

    Declaration

    Swift

    open let showFilters: Bool
  • Enable/Disable filter intensity slider.

    Declaration

    Swift

    open let showFilterIntensitySlider: Bool
  • The initial intensity of the filters.

    Declaration

    Swift

    open let initialFilterIntensity: CGFloat
  • Allowed camera positions. Defaults to all available positions and falls back to supported position if only one exists.

    Declaration

    Swift

    open 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

    open 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

    open 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. To set this option from Obj-C see allowedRecordingModesAsNSNumbers.

    Declaration

    Swift

    open let allowedRecordingModes: [RecordingMode]
  • The video output settings to use for video recording. If nil, the recommended video settings for file type AVFileTypeQuickTimeMovie will be used.

    Declaration

    Swift

    open let videoOutputSettings: [String : AnyObject]?
  • The video output settings to use for video recording. If nil, the recommended audio settings for file type AVFileTypeQuickTimeMovie will be used.

    Declaration

    Swift

    open 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 change videoOutputSettings and audioOutputSettings.

    Declaration

    Swift

    open let videoRecordingFileType: AVFileType
  • The extension to use for video files. Default is mov.

    Declaration

    Swift

    open let videoRecordingFileExtension: String
  • Use this closure to further configure the asset writer that is created for video recording.

    Declaration

    Swift

    open let assetWriterConfigurationClosure: ((AVAssetWriter) -> Void)?
  • Whether the user’s location should be included in photos. This is enabled by default.

    Declaration

    Swift

    open let includeUserLocation: Bool