CameraTorchListener
The protocol that handles the torch state when the torch state changes.
@protocol CameraTorchListener <NSObject>
Method | Type | Description |
---|---|---|
didChangeTorchState |
required | The method for user to add code when torch state is changed. |
didChangeTorchState
The method for user to add code when torch state is changed.
- (void)didChangeTorchState:(TorchState)torchState NS_SWIFT_NAME(didChangeTorchState(torchState:));
Parameters
TorchState
: The torch status.
Code Snippet
- Objective-C
- Swift
[_dce addTorchListener:self]; // Add protocol requirements - (void)didChangeTorchState:(TorchState) torchState{ // TODO add your code for torch listener }
dce.addTorchListener(self) // Add protocol requirements func didChangeTorchState(torchState: TorchState){ // TODO add your code for torch listener }