GSKCameraSession

Objective-C

@interface GSKCameraSession : NSObject

Swift

class GSKCameraSession : NSObject

The GSKCameraSession class manages the interactions with the device camera.

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Declaration

    Objective-C

    - (nonnull instancetype)initWithConfiguration:
        (nonnull GSKCameraSessionConfiguration *)configuration;

    Swift

    init(configuration: GSKCameraSessionConfiguration)

    Parameters

    configuration

    The configuration for the camera session

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) GSKCaptureHandler *cameraCaptureHandler

    Swift

    var cameraCaptureHandler: GSKCaptureHandler { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) AVCaptureDevice *captureDevice

    Swift

    var captureDevice: AVCaptureDevice? { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) AVCaptureDeviceInput *captureInput

    Swift

    var captureInput: AVCaptureDeviceInput? { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) AVCaptureSession *captureSession

    Swift

    var captureSession: AVCaptureSession? { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) AVCaptureConnection *captureConnection

    Swift

    var captureConnection: AVCaptureConnection? { get }
  • Controls when the video session starts and stops delivering photos

    Declaration

    Objective-C

    - (void)startSessionOnComplete:(nonnull void (^)(void))onComplete;

    Swift

    func start(onComplete: @escaping () -> Void)
  • Undocumented

    Declaration

    Objective-C

    - (void)stopSessionOnComplete:(void (^)(void))onComplete;

    Swift

    func stop(onComplete: @escaping () -> Void)
  • Undocumented

    Declaration

    Objective-C

    - (void)pauseSession;

    Swift

    func pause()
  • Undocumented

    Declaration

    Objective-C

    - (void)resumeSession;

    Swift

    func resumeSession()
  • Sets focus point.

    Declaration

    Objective-C

    - (void)focusAtPoint:(CGPoint)focusPoint;

    Swift

    func focus(at focusPoint: CGPoint)
  • Change the flash status.

    Declaration

    Objective-C

    @property (nonatomic) GSKCameraSessionFlashStatus flashStatus;

    Swift

    var flashStatus: GSKCameraSessionFlashStatus { get set }
  • Returns false if flash isn’t supported on this device configuration.

    Declaration

    Objective-C

    @property (nonatomic) BOOL supportsFlash;

    Swift

    var supportsFlash: Bool { get set }
  • Manually take a photo

    If autoTriggerEnabled is YES, the photo is taken automatically when the frame is detected. Otherwise, if you want to let the user manually trigger the photo, you can use this method.

    This method can be called even when activeDetectionMode is higlightAndTrigger and will force taking the photo.

    IMPORTANT: Taking the photo will pause the session. You have to resume the session will resumeSession once you are done processing the result.

    Declaration

    Objective-C

    - (void)takePhoto;

    Swift

    func takePhoto()
  • True for the duration of taking the photo and processing it. Observable.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isTakingPhoto) BOOL takingPhoto;

    Swift

    var isTakingPhoto: Bool { get }
  • Returns the current status of the document detection.

    While you can configure the desired mode when setting up the session, the current value can change: for instance, the document detection is disabled while taking the photo.

    Observable.

    Declaration

    Objective-C

    @property (nonatomic, readonly) GSKCameraSessionDocumentDetection activeDocumentDetection;

    Swift

    var activeDocumentDetection: GSKCameraSessionDocumentDetection { get }
  • Camera won’t be used anymore in this session. Makes sure everything can be deallocated successfully.

    Declaration

    Objective-C

    - (void)cleanup;

    Swift

    func cleanup()
  • The camera session delegate.

    This must be the cameraViewController.

    See

    GSKCameraSessionDelegate

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<GSKCameraSessionDelegate> delegate;

    Swift

    weak var delegate: GSKCameraSessionDelegate? { get set }