CameraViewControllerOptionsBuilder

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKCameraViewControllerOptionsBuilder)
open class CameraViewControllerOptionsBuilder : NSObject

The default CameraViewControllerOptionsBuilder for CameraViewControllerOptions.

  • 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 var backgroundColor: UIColor?
  • Use this closure to configure the cancel button.

    Declaration

    Swift

    open var cancelButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the flash button. Defaults to an empty implementation.

    Declaration

    Swift

    open var flashButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the switch camera button. Defaults to an empty implementation.

    Declaration

    Swift

    open var switchCameraButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the camera roll button. Defaults to an empty implementation.

    Declaration

    Swift

    open var cameraRollButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the action button in photo mode. Defaults to an empty implementation.

    Declaration

    Swift

    open var photoActionButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the filter selector button. Defaults to an empty implementation.

    Declaration

    Swift

    open var filterSelectorButtonConfigurationClosure: ButtonConfigurationClosure?
  • Use this closure to configure the timelabel. Defaults to an empty implementation.

    Declaration

    Swift

    open var timeLabelConfigurationClosure: ((UILabel) -> Void)?
  • Use this closure to configure the filter intensity slider. Defaults to an empty implementation.

    Declaration

    Swift

    open var 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 var recordingModeButtonConfigurationClosure: ((Button, RecordingMode) -> Void)?
  • Enable/Disable permanent crop to square. Disabled by default.

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    open var 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

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    open var 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 var 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 var 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

    open var 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 var 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 var 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 var videoRecordingFileType: AVFileType
  • The extension to use for video files. Default is “mov”.

    Declaration

    Swift

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

    Declaration

    Swift

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

    Attention

    When this is set to true, you must either request location access within your host app or set CameraViewController.locationAccessRequestClosure.

    Declaration

    Swift

    open var includeUserLocation: Bool
  • Whether the recorded video should include the applied filter or not. This is disabled by default.

    Declaration

    Swift

    open var writeVideoWithFilterApplied: Bool
  • An array of AVCaptureDevicePosition raw values wrapped in NSNumbers. Setting this property overrides any previously set values in allowedCameraPositions with the corresponding unwrapped values.

    Declaration

    Swift

    @objc(allowedCameraPositions)
    open var _objCAllowedCameraPositions: [NSNumber] { get set }
  • An array of AVCaptureFlashMode raw values wrapped in NSNumbers. Setting this property overrides any previously set values in allowedFlashModes with the corresponding unwrapped values.

    Declaration

    Swift

    @objc(allowedFlashModes)
    open var _objCAllowedFlashModes: [NSNumber] { get set }
  • An array of AVCaptureTorchMode raw values wrapped in NSNumbers. Setting this property overrides any previously set values in allowedFlashModes with the corresponding unwrapped values.

    Declaration

    Swift

    @objc(allowedTorchModes)
    open var _objCAllowedTorchModes: [NSNumber] { get set }
  • An array of RecordingMode raw values wrapped in NSNumbers. Setting this property overrides any previously set values in allowedRecordingModes with the corresponding unwrapped values.

    Declaration

    Swift

    @objc(allowedRecordingModes)
    open var _objCAllowedRecordingModes: [NSNumber] { get set }