ios - Photos framework checking image type -


i have code fetching photos library , accessing types. have no idea how check whether image png or jpeg.? alassetlibrary can easily. want implement photos framework. have idea.? suggestions. in advance.

try:

let asset: phasset = ... let opts = phimagerequestoptions() // opts.synchronous = true // if want synchronous callback opts.version = phimagerequestoptionsversion.original phimagemanager.defaultmanager().requestimagedataforasset(asset, options: opts) { _, uti, _, _ in     println(uti) } 

i don't know how without fetching actual data.


to convert uti mime-type:

import mobilecoreservices  let uti = ... let mime = uttypecopypreferredtagwithclass(uti, kuttagclassmimetype).takeretainedvalue() 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -