Switch value if running on an iPad instead of an iPhone

Is there any way to evaluate during run time whether an app is running on an iPad or an iPhone? I’d like to create two separate versions of each menu widget and load them depending on whichever device is currently being used, given that the display ratios on both devices are so different.

Evyr iPad has a different Resolution than the iphones. If you do a check on the screen resolutions of all iphones (get Resolution and check if it fits to 4,4s,5,6,6plus,x,xr,xs,xsmax) then you know it is a n iPhone model if it is true(iPad=false), else iPad is the case (iPad=true) see online how to get the Resolution in objective c or Maybe blueprint works as well for it