The preferred way to do this is to try to create contexts for the various OpenGL ES versions and fall back to older ones if they fail. For example, you could check for OpenGL ES 3 support using:
EAGLContext *aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
if aContext
is nil, that device doesn't support OpenGL ES 3.0. You can then fall back to
aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
to test for 2.0 support. If that fails (aContext
is nil again), then the device only supports OpenGL ES 1.1. This doesn't require you to check device types (and it accounts for future, unreleased devices).