It is fairly well known that Apple gives very little information away in the User Agent. All it really surrenders is the device family (e.g. iPhone, iPad, iPod) and the iOS version.
There is an ongoing argument about whether it is appropriate to use device detection to modify the appearance of your website – many argue that feature detection is far superior, and any site intended for a mobile/tablet audience in particular should be responsive. To be perfectly honest, it’s not an argument I really want to get involved in. There are reasons why you may still wish to identify which physical device a visitor is using, rather than just which iOS version and device family.
For example, not all iPhones are equal – if nothing else, the performance of the iPhone 3G is very poor when compared to the iPhone 5. If you are developing a site which is CPU intensive then optimising the site for the iPhone 3G may be a costly and time consuming exercise. If only a small percentage of your customer base uses the iPhone 3G, then the business case for optimising the site may not stack up.
That is just one example of why it may be valuable to know which physical devices your customers use – there are plenty of others. Regardless of why you want to detect it, the method detailed here may help you to do it.