Use this:
if ([self.captureSession canSetSessionPreset:AVCaptureSessionPreset1920x1080])
{
self.captureSession.sessionPreset = AVCaptureSessionPreset1920x1080;
} else if ([self.captureSession canSetSessionPreset:AVCaptureSessionPreset640x480])
{
NSLog(@"Set preview port to 640X480");
self.captureSession.sessionPreset = AVCaptureSessionPreset640x480;
}