The current range of iOS devices that support 7.0+ don't include any devices that lack a front-facing camera. I also agree with you that it is unlikely that Apple will release any future devices without the front-facing camera (though not impossible). Even if they do, however, you could and should specify that your app requires this hardware in the UIRequiredDeviceCapabilities
as 200_success points out.
With all that said, however... it is still absolutely vital that you check that any media source is available before attempting to use it.
Before iOS7, I presumed this check was only to determine whether or not the device existed, but it does more than that actually. As noted here, there are reasons besides the camera not existing that would cause isSourceTypeAvailable:
to return NO
, and as such, we always need to check its availability (even if we're just going to the camera roll, which every device will have).
Addendum: In regards to specifically checking for the camera, rather than delete working code, I might recommend cleaning it up, writing it into a function, and putting it in some file in your project where you keep sort of globalish functions. It doesn't hurt for the function to simply exist and never be called... but if you delete and for some reason find out later that you actually did need it, it might be hard to remember how to properly implement. There's no sense in deleting code that works.
And if you are keeping it, it can be cleaned up slightly:
BOOL deviceHasFrontCamera() {
for (AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
if (device.position == AVCaptureDevicePositionFront) {
return YES;
}
}
return NO;
}