Quantcast
Channel: UIImagePickerController no overlay on preview/skip preview - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Yadigar ZENGİN for UIImagePickerController no overlay on preview/skip preview

$
0
0

I don't know still anyone following this issue but it's possible to popBack and then show/present another screen/overlay for the additional trim/crop/editting and when cancel back to folder with staying same scroll level.

Code snippet here:

where ever you want to show image picker

present(imagePicker, animated: true)

then at the finish of picking(this issue only happens pick video)

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {    let mediaType = info[UIImagePickerController.InfoKey.mediaType] as! String    if (mediaType == "public.image"){        NSLog("%@", "got image")    }else if (mediaType == "public.movie"){        NSLog("%@", "got movie")        // dismiss(animated: true)        let trimView = storyBoard.instantiateViewController(withIdentifier: "TrimView") as! TrimViewController        trimView.delegate = self        trimView.modalPresentationStyle = .pageSheet        imagePicker.popViewController(animated: false)        imagePicker.present(trimView, animated: true)    }}

with adding some additional delegates or with compilation however you does, at cancel handler of TrimViewController do this for go back to last position of UIImagePickerController picking view

func didFinishTrim() {    imagePicker.dismiss(animated: true)}

hope helps!


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>