My code takes a photo using image Picker and places it on a imageview. The problem is that the subview on the image picker is not being transferred. How can I transfer the subview on top of the image taken.
@IBAction func takePhoto(_ sender: UIButton) {
imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = .camera
present(imagePicker, animated: true, completion: nil)
let mainView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height-150))
let frame = CGRect.init(x: 0, y: 0, width: self.view.frame.size.width, height: 120)
let blockView = UIImageView.init(frame: frame)
blockView.contentMode = .scaleAspectFit
blockView.image = UIImage(named: "f")
mainView.addSubview(blockView)
imagePicker.cameraOverlayView = mainView
}