Skip to content

Instantly share code, notes, and snippets.

@directionforward
Forked from codearryaas/detect-ios.js
Created January 21, 2021 11:53
Show Gist options
  • Select an option

  • Save directionforward/28536cffd57ac3dafdd43aa0a9e44b2d to your computer and use it in GitHub Desktop.

Select an option

Save directionforward/28536cffd57ac3dafdd43aa0a9e44b2d to your computer and use it in GitHub Desktop.

Revisions

  1. @codearryaas codearryaas created this gist Nov 17, 2019.
    6 changes: 6 additions & 0 deletions detect-ios.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    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');
    }