This code does not show the detection of face in camera, even there is no error. I want the face should be detected in realtime in camera with red squire surrounded, but I
You most probably need just to trigger the function the way how it is described in the document
We will invoke the detect method in viewDidLoad. So insert the following line of code in the method:
override func viewDidLoad() {
super.viewDidLoad()
detect()
}
Compile and run the app.
EDIT: This is solution while the function "detect" is as a subclass method, but in your case, you use IBAction, which has different syntax like this. You should try to delete name of the function detect() and this bracket
}
let picker =
and this part have to inside a function
let picker = UIImagePickerController()
picker.delegate = self
picker.allowsEditing = true
picker.sourceType = .camera
picker.cameraDevice = .front
self.present(picker, animated: true, completion: { _ in })
for your case you can probably omit this part as well.