title: Error: "use of unresolved identifier"
body: <p>I am making a face detection app. I have written some code for detection but I am getting an error. Kindly suggest me an alternate solution.
  Here is the code, and the error is at line number 3.</p>
  
  <pre><code>import UIKit
  import CoreImage
  
  class ViewController: UIViewController ,UIAlertViewDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate  {
  
      @IBOutlet var imageView: UIImageView!
      @IBAction func Moodify(_ sender: UIButton) {
  
          let picker = UIImagePickerController()
          picker.delegate = self
          picker.allowsEditing = true
          picker.sourceType = .camera
          self.present(picker, animated: true, completion: { _ in })
  
  
          func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [AnyHashable: Any]) {
              let chosenImage = info[UIImagePickerControllerEditedImage]
              self.imageView!.image = chosenImage as? UIImage
              picker.dismiss(animated: true, completion: { _ in })
          }
  
          func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
              picker.dismiss(animated: true, completion: { _ in })
          }
  
      }
  
      func detect() {
  
          guard let personciImage = CIImage(image: personPic.image!) else {
              return
          }
  
          let accuracy = [CIDetectorAccuracy: CIDetectorAccuracyHigh]
          let faceDetector = CIDetector(ofType: CIDetectorTypeFace, context: nil, options: accuracy)
          let faces = faceDetector.featuresInImage(personciImage)
  
          for face in faces as! [CIFaceFeature] {
  
              print("Found bounds are \(face.bounds)")
  
              let faceBox = UIView(frame: face.bounds)
  
              faceBox.layer.borderWidth = 3
              faceBox.layer.borderColor = UIColor.redColor().CGColor
              faceBox.backgroundColor = UIColor.clearColor()
              personPic.addSubview(faceBox)
  
              if face.hasLeftEyePosition {
                  print("Left eye bounds are \(face.leftEyePosition)")
              }
  
              if face.hasRightEyePosition {
                  print("Right eye bounds are \(face.rightEyePosition)")
              }
          }
      }    
  
      override func viewDidLoad() {
  
          let alert = UIAlertController(title: "Error", message: "Device has no camera", preferredStyle: UIAlertControllerStyle.alert)
          alert.addAction(UIAlertAction(title: "Click", style: UIAlertActionStyle.default, handler: nil))
          self.present(alert, animated: true, completion: nil)
  
  
      /*    if !UIImagePickerController.isSourceTypeAvailable(.camera) {
              let myAlertView = UIAlertView (title: "Error", message: "Device has no camera", delegate: nil, cancelButtonTitle: "OK", otherButtonTitles: "")
              myAlertView.show()
          }  */
  
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/KxSIo.png" alt="SEE ERROR IN THIS IMAGE"></p>