Skip to content

Commit 2ba0998

Browse files
committed
Introduces Lib.isIOS() to detect Apple mobile devices
1 parent 9b8a843 commit 2ba0998

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,11 @@ lib.isSafari = function() {
712712
return IS_SAFARI_REGEX.test(window.navigator.userAgent);
713713
};
714714

715+
var IS_IOS_REGEX = /iPad|iPhone|iPod/;
716+
lib.isIOS = function() {
717+
return IS_IOS_REGEX.test(window.navigator.userAgent);
718+
}
719+
715720
/**
716721
* Duck typing to recognize a d3 selection, mostly for IE9's benefit
717722
* because it doesn't handle instanceof like modern browsers

0 commit comments

Comments
 (0)