Skip to content

Instantly share code, notes, and snippets.

@codearryaas
Created November 17, 2019 17:00
Show Gist options
  • Save codearryaas/d6bc868d9f545b7d658235128fb595af to your computer and use it in GitHub Desktop.
Save codearryaas/d6bc868d9f545b7d658235128fb595af to your computer and use it in GitHub Desktop.
JavaScript: How to detect if device is iOS?
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (isIOS) {
console.log('This is a IOS device');
} else {
console.log('This is Not a IOS device');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment