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 |
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. |
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. } } ```