private static function checkIOS(Os $os, UserAgent $userAgent)
    {
        if (stripos($userAgent->getUserAgentString(), 'CPU OS') !== false ||
            stripos($userAgent->getUserAgentString(), 'iPhone OS') !== false &&
            stripos($userAgent->getUserAgentString(), 'OS X')) {
            $os->setName($os::IOS);
            if (preg_match('/CPU( iPhone)? OS ([\d_]*)/i', $userAgent->getUserAgentString(), $matches)) {
                $os->setVersion(str_replace('_', '.', $matches[2]));
            }
            $os->setIsMobile(true);

            return true;
        }

        return false;
    }