Skip to content

Latest commit

 

History

History
81 lines (70 loc) · 1.94 KB

protocol-dcecamerastatelistener-v3.0.3.md

File metadata and controls

81 lines (70 loc) · 1.94 KB
layout title description keywords needAutoGenerateSidebar noTitleIndex needGenerateH3Content breadcrumbText permalink
default-layout
iOS Protocol DCECameraStateListener - Dynamsoft Camera Enhancer
This is the documentation - iOS Protocol DCECameraStateListener page of Dynamsoft Camera Enhancer.
Camera Enhancer, iOS Protocol DCECameraStateListener
true
true
false
iOS Protocol DCECameraStateListener
/programming/ios/auxiliary-api/protocol-dcecamerastatelistener-v3.0.3.html

DCECameraStateListener

The protocol to handle callback when camera state changes.

>- Objective-C >- Swift > >1. ```objc @protocol DCECameraStateListener ``` 2. ```swift protocol DCECameraStateListener : NSObjectProtocol ```
Method Type Description
stateChangeCallback required The callback method is triggered when camera state changes.

stateChangeCallback

The callback method is triggered when camera state changes.

>- Objective-C >- Swift > >1. ```objc - (void)stateChangeCallback:(EnumCameraState)cameraState; ``` 2. ```swift func stateChangeCallback(_ currentState: EnumCameraState) ```

Parameters

cameraState: The camera state. It includes opened, opening, closed and closing.

Code Snippet

>- Objective-C >- Swift > >1. ```objc @interface ViewController () - (void)configurationDCE{ [_dce setCameraStateListener:self]; } - (void)stateChangeCallback:(EnumCameraState)state{ // Add your code to do when camera state changes. } ``` 2. ```swift class ViewController: UIViewController,DCECameraStateListener{ func configurationDCE(){ dce.setCameraStateListener(self) } func stateChangeCallback(EnumCameraState currentState){ // Add your code to do when camera state changes. } } ```