Swift - Is it possible to select a video from the library on the iOS simulator? -


all shows when use uiimagepickercontroller library of photos. have mp4 video saved simulator library, never shows in list when access simulator library programmatically uiimagepickercontroller. there i'm doing wrong?

based on swift 2.2

your code may this:

@ibaction func selectimagefromphotolibrary(sender: uibarbuttonitem) {      let imagepickercontroller = uiimagepickercontroller()      imagepickercontroller.sourcetype = .photolibrary     imagepickercontroller.delegate = self      imagepickercontroller.mediatypes = ["public.image", "public.movie"]     presentviewcontroller(imagepickercontroller, animated: true, completion: nil) } 

actually can answers apple document:

uiimagepickercontroller class reference

the useful method class func availablemediatypesforsourcetype.

you can try this:

let types = uiimagepickercontroller.availablemediatypesforsourcetype(.photolibrary) print(types) 

then know videos types named public.movie , not kuttypemovie anymore.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -