Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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