美文网首页
无形的坑(Swift4.0代理方法不走的bug)

无形的坑(Swift4.0代理方法不走的bug)

作者: AnnieAri | 来源:发表于2017-11-13 18:56 被阅读0次

很简单 苹果专门写了更加符合swift的代理方法 而原来有的是直接用的Obj的转换出的framework简单的例子:
AVFoundation框架里面的
AVCaptureVideoDataOutputSampleBufferDelegate

//原来的
    func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!) 
///现在的   
    func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) 

相关文章

网友评论

      本文标题:无形的坑(Swift4.0代理方法不走的bug)

      本文链接:https://www.haomeiwen.com/subject/thxtvxtx.html