我在swift中使用AVFoundation来拍照,但我无法将任何功能代码行从objectivec转换为Swift。我的函数代码是:-(void)capImage{//methodtocaptureimagefromAVCaptureSessionvideofeedAVCaptureConnection*videoConnection=nil;for(AVCaptureConnection*connectioninstillImageOutput.connections){for(AVCaptureInputPort*portin[connectioninputPorts]){if([