无形的坑(Swift4.0代理方法不走的bug)
2017-11-13 本文已影响0人
AnnieAri
很简单 苹果专门写了更加符合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)