From http://stackoverflow.com/questions/9038625/detect-if-device-is-ios