LMFaceDetectionView
@MainActor
public class LMFaceDetectionView : UIView, LMFaceDetectionViewProtocol
This class defines UIView which will be tracking face area on video feed.
-
Object must be initialized with colors for default bahaivor.
Declaration
Swift
@MainActor public init(positiveDetectionColor: UIColor, negativeDetectionColor: UIColor)
Parameters
positiveDetectionColor
when face detected and best shot search process began this color will be used as border color for default tracking frame
negativeDetectionColor
when face not found or best shot errors appeared, this color will be used as border color for default tracking frame
-
This method should be used in case of custom bahivor and inheritence
Declaration
Swift
@MainActor public override init(frame: CGRect)
Parameters
frame
as usually frame rect
-
Default implementation. Don’t use.
Declaration
Swift
@MainActor required public init?(coder: NSCoder)
Parameters
coder
default argument
-
When face was found and can be tracked this method will be launched. Base implementation simply changes the colors of border. You can override this method to implement your own logic
Declaration
Swift
@MainActor public func switchToPositiveState()
-
When face was found but can not be tracked by different reasons and errors this method will be launched. Base implementation simply changes the colors of border. You can override this method to implement your own logic
Declaration
Swift
@MainActor public func switchToNegativeState()