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
Post a Comment