I started with the site referenced here but it did not have the web-kit build number, which is what Google Analytics displays. I found a more complete list at useragentstring.com/pages/Safari.
–
Andrew SteitzSep 4 '12 at 14:11

I found a more complete listing at user agent string. BTW, this site has more than just iOS user agent strings. Also, the home page will "break down" the user agent string of your current browser for you.

Well, I, personally would detect more than just iPhone, because in the example above you are not rendering iOS 5 specific code to iPads and iPod touch. What you might also want to think about is the fact that the version will increment at some point. My recommendation would probably be apparent to most - detect an apple mobile device first, i.e. iPad/iPod/iPhone and then, if that's the case, parse out the version of... not the iOS but probably the browser, i.e. in this case Version/5.1 would be the indicator. Once you know the version, you would apply your code on "not lower than" condition.
–
RaineOct 21 '11 at 22:29

Thanks for the response, but note that this isn't an efficient way and some device versions will be lost. For example I just checked the user agent on my ancient iPad 1 and it says "...iPad; CPU OS 5_1_1...". None of your variables would have caught that. You would need a regex like var iOS5 = /(iPhone|iPad).*OS 5_.*/i.test(navigator.userAgent);
–
Mauvis LedfordOct 14 '12 at 3:04