I can detect iOS 13 on iPhone but in iPad OS 13 navigator.platform comes as MacIntel. So it is not possible to get iPad identified using below code, but it work
It's a bit hackish and surely not very future safe but for now we are using the following and it seems to do the trick.
The first block is just sniffing the user agent for older iPads and the the second block after 'OR' is checking if the platform is Macintosh and has touch points. At the time of writing this, there's no official touch screen for Mac yet, so it should be pretty safe for a while.
if ((/\b(iPad)\b/.test(navigator.userAgent)
&& /WebKit/.test(navigator.userAgent)
&& !window.MSStream)
|| (navigator.platform === 'MacIntel'
&& navigator.maxTouchPoints
&& navigator.maxTouchPoints === 5)
) {
return true;
}