ios - Lock camera in landscape orientation -


i have app lets user take picture camera. allow user take landscape photos, not portrait. there way me lock camera orientation?

below code using:

func takephoto() {     //if camera available on device, go camera.  if not, present error message.     if uiimagepickercontroller.issourcetypeavailable(uiimagepickercontrollersourcetype.camera){         //create image picker controller         imagepicker = uiimagepickercontroller()         imagepicker.delegate = self         imagepicker.sourcetype = .camera          //present camera view         presentviewcontroller(imagepicker, animated: true, completion: nil)     }     else {         let alert = uialertcontroller(title: "error", message: "there no camera available", preferredstyle: uialertcontrollerstyle.alert)         alert.addaction(uialertaction(title: "ok", style: .default, handler: {(alertaction) in alert.dismissviewcontrolleranimated(true, completion: nil)}))         self.presentviewcontroller(alert, animated: true, completion: nil)     } } 

is there way me lock camera orientation

the camera physical object. orientation has nothing app. way "lock camera orientation" reach out , grab user's wrist s/he can't turn device.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -