I need to remove the zoom slider in the camera screen. This is my code:
import UIKit
extension UIImagePickerController {
class func sourceCameraModePhoto(_ delegate: UIImagePickerControllerDelegate & UINavigationControllerDelegate, overlayView: UIView) -> UIImagePickerController {
let picker = UIImagePickerController()
picker.sourceType = .camera
picker.cameraCaptureMode = .photo
picker.showsCameraControls = false
picker.view.addSubview(overlayView)
picker.delegate = delegate
return picker
}
showsCameraControls
should be set before theUIImageViewController
is loaded.That means you could it in the initialization of a customized
UIImageViewController
.I guess found the answer to this issue: The zoom slider is a UISlider, if your imagePickerController's view property contains a UISlider down its subviews, you can set its alpha to zero. This issue happens if you upgrade to iOS10.
I hope this helps.
Let me know if there is a better solution.
This will remove the zoom slider:
picker.view.isUserInteractionEnabled = false
And it's probably future proof too.
The above knocks out user interaction for the camera.
Here is what worked for me finally.
Add the cameraOverlay as a subview to the picker.