Getting the max texture size allowed at runtime

Is there a way to get the max texture size allowed from the current platform at runtime? I'm making a game for iPhone and I want to use a 2048 texture for the newer models, and 1024 for the models that doesn't allow that.

Can I get this somehow, or is there any other solution to this problem?

You could use the class SystemInfo: graphicsMemorySize or graphicsDeviceVersion

(But I am not sure if it is available or applicable on iOS.)