Switch cameras with avcapturesession

You first need to remove the existing AVCameraInput from the AVCaptureSession and then add a new AVCameraInput to the AVCaptureSession. The following works for me (under ARC): -(IBAction)switchCameraTapped:(id)sender { //Change camera source if(_captureSession) { //Indicate that some changes will be made to the session [_captureSession beginConfiguration]; //Remove existing input AVCaptureInput* currentCameraInput = [_captureSession.inputs objectAtIndex:0]; [_captureSession … Read more