Device.iOSVersion now contains the major version number of iOS.

This commit is contained in:
photonstorm 2015-09-22 11:46:20 +01:00
parent 27457c2b0f
commit d16de32fe3

View file

@ -57,6 +57,12 @@ Phaser.Device = function () {
*/
this.iOS = false;
/**
* @property {number} iOSVersion - If running in iOS this will contain the major version number.
* @default
*/
this.iOSVersion = 0;
/**
* @property {boolean} cocoonJS - Is the game running under CocoonJS?
* @default
@ -658,6 +664,8 @@ Phaser.Device._initialize = function () {
else if (/iP[ao]d|iPhone/i.test(ua))
{
device.iOS = true;
var v = (navigator.appVersion).match(/OS (\d+)/);
device.iOSVersion = parseInt(RegExp.$1, 10);
}
else if (/Linux/.test(ua))
{