INNER CODE UNIT · JavaScript

isIPad

lucasferreira/react-native-flash-message · src/FlashMessageWrapper.js:20

const isIPad = (() => {
  if (Platform.OS !== "ios" || isIPhoneX) return false;

  // if portrait and width are smaller than the iPad's width...
  if (D_HEIGHT > D_WIDTH && D_WIDTH < PAD_WIDTH) {
    return false; // It is probably not an iPad
  }

  // if landscape and height are smaller that the iPad's height...
  if (D_WIDTH > D_HEIGHT && D_HEIGHT < PAD_WIDTH) {
    return false; // It is probably not an iPad
  }

  // If all verifications go alright
  // then it is probably an iPad
  return true;
})();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…