CameraViewController

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKCameraViewController)
open class CameraViewController : UIViewController

The CameraViewController class provides a dialog to perform serveral tasks regarding the camera. These include taking photos, switching on the flash, and such.

  • Creates a camera view controller using the given parameters.

    Note

    If you use the standard init() method or init?(coder:) to initialize a CameraViewController object, a camera view controller with all supported recording modes and the default configuration is created.

    Declaration

    Swift

    public init(configuration: Configuration = Configuration())

    Parameters

    configuration

    A Configuration object.

  • The view that contains the background views.

    Declaration

    Swift

    open private(set) lazy var backgroundContainerView: UIView { get set }
  • The view that contains all view positioned at the top of the screen.

    Declaration

    Swift

    open private(set) lazy var topControlsView: UIView { get set }
  • The view that serves as container for the actual preview.

    Declaration

    Swift

    open private(set) lazy var cameraPreviewContainer: UIView { get set }
  • The view that contains all view positioned at the bottom of the screen.

    Declaration

    Swift

    open private(set) lazy var bottomControlsView: UIView { get set }
  • The view that spans from the bottom of the screen to the bottom of the safeAreaLayoutGuide. This is only visible on an iPhone X.

    Declaration

    Swift

    open private(set) lazy var bottomSafeAreaHidingView: UIView { get set }
  • The cancel button.

    Declaration

    Swift

    open private(set) lazy var cancelButton: Button { get set }
  • The flash button.

    Declaration

    Swift

    open private(set) lazy var flashButton: Button { get set }
  • The camera switch button.

    Declaration

    Swift

    open private(set) lazy var switchCameraButton: Button { get set }
  • The camera roll button

    Declaration

    Swift

    open private(set) lazy var cameraRollButton: Button { get set }
  • The view that contains actions button that is used to initiate the photo capturing process.

    Declaration

    Swift

    open private(set) lazy var actionButtonContainer: UIView { get set }
  • The label that is used to display the current recording time.

    Declaration

    Swift

    open private(set) lazy var recordingTimeLabel: UILabel { get set }
  • The button that is used to initiate the photo capturing process.

    Declaration

    Swift

    open private(set) var actionButton: UIControl?
  • The view that is used to select the current filter that is applied to the preview.

    Declaration

    Swift

    open private(set) lazy var filterSelectionButton: Button { get set }
  • The slider that is used to control the inensity of the previewed filter.

    Declaration

    Swift

    open private(set) lazy var filterIntensitySlider: Slider { get set }
  • The recognizer that detects a swipe gesture to the right.

    Declaration

    Swift

    open private(set) lazy var swipeRightGestureRecognizer: UISwipeGestureRecognizer { get set }
  • The recognizer that detects a swipe gesture to the left.

    Declaration

    Swift

    open private(set) lazy var swipeLeftGestureRecognizer: UISwipeGestureRecognizer { get set }
  • The recognizer that detects a pinch gesture.

    Declaration

    Swift

    open private(set) lazy var pinchGestureRecognizer: UIPinchGestureRecognizer { get set }
  • The instance of a FilterSelectionController that is used to select the current preview filter.

    Declaration

    Swift

    open let filterSelectionController: FilterSelectionController
  • The camera controller that is used by the controller.

    Declaration

    Swift

    open private(set) var cameraController: CameraController?
  • The block that is called when the user taps the cancel button.

    Declaration

    Swift

    open var cancelBlock: (() -> Void)?
  • The block that is called once the capture process has finished.

    Declaration

    Swift

    open var completionBlock: ((UIImage?, URL?) -> Void)?
  • The block that is called once a photo has been taken. It is passed a Data instance, containing a JPEG image with metadata. The UIImage passed to completionBlock does not contain any metadata. If this is set, then completionBlock won’t be called.

    Declaration

    Swift

    open var dataCompletionBlock: ((Data?) -> Void)?
  • This function gets the most recent image form the camera roll, and sets it as preview image for the according button.

    Declaration

    Swift

    open func setLastImageFromRollAsPreview()
  • Takes a photo.

    Declaration

    Swift

    @objc
    open func takePhoto(_ sender: Button?)

    Parameters

    sender

    The object that initiated the request.

  • Toggles video recording.

    Declaration

    Swift

    @objc
    open func recordVideo(_ sender: VideoRecordButton?)

    Parameters

    sender

    Sender of the event.