Last active
December 22, 2020 00:34
-
-
Save memob0x/0869e759887441b1349fdfe6bf5a188d to your computer and use it in GitHub Desktop.
Detect Apple touch capable devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const isAppleTouchDevice = ({userAgent, platform, maxTouchPoints} = window.navigator) => { | |
const isLegacyIOS = /iPad|iPhone|iPod/.test(userAgent); | |
const isMultiTouchMacAkaIOS13 = platform === "MacIntel" && maxTouchPoints > 1; | |
return isLegacyIOS || isMultiTouchMacAkaIOS13; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment