0

I know If you want to use camera or photo library in the app you have to add privacy description in the info part and I added that and write a text in that But The app shows Error and tell me you have to add Privacy Description

here is my code

class ViewController: UIViewController , UINavigationControllerDelegate , UIImagePickerControllerDelegate {


@IBOutlet var myimageView: UIImageView!

@IBAction func importImage(_ sender: Any) {

    let image = UIImagePickerController()
    image.delegate = self
    image.sourceType = UIImagePickerControllerSourceType.photoLibrary

    image.allowsEditing = false
    self.present(image , animated: true)
    {

    }
}


func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
    if let image = info[UIImagePickerControllerOriginalImage] as? UIImage{
        myimageView.image = image
    }
    else {
        print("Error")
    }

    self.dismiss(animated: true, completion: nil)

}
 @IBOutlet var translatebackgroundimg: UIImageView!
@IBOutlet var translatefrontimg: UIImageView!
override func viewDidLoad() {
    super.viewDidLoad()

    let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.light)
    let blurView = UIVisualEffectView(effect: blurEffect)

    blurView.frame =  CGRect(x: self.translatebackgroundimg.frame.origin.x, y: self.translatebackgroundimg.frame.origin.y, width: self.translatebackgroundimg.frame.size.width, height: self.translatebackgroundimg.frame.size.height)

    blurView.autoresizingMask = [.flexibleWidth, .flexibleHeight]

    self.translatebackgroundimg.addSubview(blurView)

    // Do any additional setup after loading the view.
    translatefrontimg.image = UIImage(named: "Translate.png")

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

override func viewDidAppear(_ animated: Bool) {

    let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.dark)
    let blurView = UIVisualEffectView(effect: blurEffect)
    blurView.frame = translatebackgroundimg.bounds
    translatebackgroundimg.addSubview(blurView)
    translatebackgroundimg.frame = self.view.bounds
}

@IBAction func cameraButton(_ sender: Any) {

    if UIImagePickerController.isSourceTypeAvailable(.camera) {
        let imagePicker = UIImagePickerController()
        imagePicker.delegate = self
        imagePicker.allowsEditing = true
        imagePicker.sourceType = UIImagePickerControllerSourceType.camera
        self.present(imagePicker, animated: true, completion: nil)



    }





}


}

Here is the Info Part Photo

Saeed Rahmatolahi
  • 1,317
  • 2
  • 27
  • 60

0 Answers0