很简单 苹果专门写了更加符合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)
网友评论