xcode - Swift Error : Use of module 'CMSampleBuffer' as a type -
i saw below question utilize 'capturestillimageasynchronouslyfromconnection' function in swift: how convert code avfoundation objective c swift?
when seek utilize avfoundation function following:
var stillimageoutput: avcapturestillimageoutput! //...initialize stillimageoutput stillimageoutput.capturestillimageasynchronouslyfromconnection(videoconnection, completionhandler: {(imagesamplebuffer, error) in if imagesamplebuffer { var imagedata = avcapturestillimageoutput.jpegstillimagensdatarepresentation(imagesamplebuffer cmsamplebuffer) // error on line saying: 'use of module ' cmsamplebuffer' type' self.processimage(uiimage(data: imagedata)) } }) i got error on xcode, says 'use of module ' cmsamplebuffer' type'. tried rewrite same line multiple times different ways, not figure out solution.
am doing wrong or perchance shaky xcode beta not working properly?
thank in advance.
@jack , @christian's solutions worked me. not careful plenty import coremedia. never used framework before, , did not know if problem due not having imported right framework. give thanks help!
xcode avfoundation swift
No comments:
Post a Comment