How to force iOS camera to take a picture programmatically using AVFoundation?
问题 I need the iOS camera to take a picture without any input from the user. How would I go about doing this? This is my code so far: -(void)initCapture{ AVCaptureDeviceInput *newVideoInput = [[AVCaptureDeviceInput alloc] init]; AVCaptureStillImageOutput *newStillImageOutput = [[AVCaptureStillImageOutput alloc] init]; NSDictionary *outputSettings = [[NSDictionary alloc] initWithObjectsAndKeys: AVVideoCodecJPEG, AVVideoCodecKey, nil]; [newStillImageOutput setOutputSettings:outputSettings];