Skip to content

Instantly share code, notes, and snippets.

@memob0x
Last active December 22, 2020 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save memob0x/0869e759887441b1349fdfe6bf5a188d to your computer and use it in GitHub Desktop.
Save memob0x/0869e759887441b1349fdfe6bf5a188d to your computer and use it in GitHub Desktop.
Detect Apple touch capable devices
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