TorchDelegate

Objective-C

@protocol TorchDelegate <NSObject>

Swift

protocol TorchDelegate : NSObjectProtocol

A protocol to receive updates from camera torch

  • To turn on the torch with power ratio

    Declaration

    Objective-C

    - (BOOL)turnTorchOnWithPowerRation:(float)powerRatio;

    Swift

    func turnTorchOn(withPowerRation powerRatio: Float) -> Bool

    Parameters

    powerRatio

    a float to represent the power ratio

  • To know when the torch light is ON

    Declaration

    Objective-C

    - (BOOL)turnTorchOn;

    Swift

    func turnTorchOn() -> Bool
  • To know when the torch light is OFF

    Declaration

    Objective-C

    - (BOOL)turnTorchOff;

    Swift

    func turnTorchOff() -> Bool