SBSDKCameraDevice

@interface SBSDKCameraDevice : NSObject

The camera device to be used with a SBSDKCameraSession. To retrieve a list of available devices you can pass to many of SDKs classic or RTU-UI component please use the class functions starting with availableDevices…

  • Not available.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Not available.

    Declaration

    Objective-C

    + (nonnull instancetype)new;
  • The type of the camera: wide angle or telephoto lens.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SBSDKCameraDeviceType deviceType;

    Swift

    var deviceType: SBSDKCameraDeviceType { get }
  • The position of the camera: front or back side camera.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SBSDKCameraDevicePosition devicePosition;

    Swift

    var devicePosition: SBSDKCameraDevicePosition { get }
  • The capture device for internal uses. Do not use directly.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) AVCaptureDevice *_Nonnull device;

    Swift

    var device: AVCaptureDevice { get }
  • The name of the camera device.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull name;

    Swift

    var name: String { get }
  • Retrieves a list of all available camera devices sorted by position (front < back) and type (wide < tele).

    Declaration

    Objective-C

    + (nonnull NSArray<SBSDKCameraDevice *> *)availableDevices;

    Swift

    class func availableDevices() -> [SBSDKCameraDevice]

    Return Value

    An array of available camera devices.

  • Retrieves a list of all available camera devices matching the given position, sorted by type (wide < tele).

    Declaration

    Objective-C

    + (nonnull NSArray<SBSDKCameraDevice *> *)availableDevicesForPosition:
        (SBSDKCameraDevicePosition)position;

    Swift

    class func availableDevices(for position: SBSDKCameraDevicePosition) -> [SBSDKCameraDevice]

    Parameters

    position

    The position for which the camera devices should be returned.

    Return Value

    An array of available camera devices matching the given position.

  • Retrieves a list of all available camera devices matching the given type, sorted by position (front < back).

    Declaration

    Objective-C

    + (nonnull NSArray<SBSDKCameraDevice *> *)availableDevicesForType:
        (SBSDKCameraDeviceType)type;

    Swift

    class func availableDevices(for type: SBSDKCameraDeviceType) -> [SBSDKCameraDevice]

    Parameters

    type

    The camera/lens type for which the camera devices should be returned.

    Return Value

    An array of available camera devices matching the given type.

  • Retrieves a list of all available camera devices matching the given type and position, sorted by position (front < back) and type (wide < tele).

    Declaration

    Objective-C

    + (nonnull NSArray<SBSDKCameraDevice *> *)
        availableDevicesForType:(SBSDKCameraDeviceType)type
                    andPosition:(SBSDKCameraDevicePosition)position;

    Swift

    class func availableDevices(for type: SBSDKCameraDeviceType, andPosition position: SBSDKCameraDevicePosition) -> [SBSDKCameraDevice]

    Return Value

    An array of available camera devices matching the given type and position.

  • Returns YES, if the device camera is mirrored, NO otherwise.

    Declaration

    Objective-C

    - (BOOL)isMirrored;

    Swift

    func isMirrored() -> Bool
  • Returns the default back side camera, which in most cases is the wide-angle camera. For iPhone 14 Pro and iPhone 14 Pro Max models the ultra-wide-angle camera is selected to avoid focusing issues with close distant objects.

    Declaration

    Objective-C

    + (nullable SBSDKCameraDevice *)defaultBackFacingCamera;

    Swift

    class func defaultBackFacingCamera() -> SBSDKCameraDevice?

    Return Value

    The default back side camera if available. Nil otherwise.

  • Returns the default front side camera, which in most cases is the frontside, wide angle camera.

    Declaration

    Objective-C

    + (nullable SBSDKCameraDevice *)defaultFrontFacingCamera;

    Swift

    class func defaultFrontFacingCamera() -> SBSDKCameraDevice?

    Return Value

    The default front side camera if available. Nil otherwise.