Consider this admirable script which draws a (circular) gradient,
https://github.com/paiv/AngleGradientLayer/blob/master/AngleGradient/AngleGradientLayer.m
What it sounds like you are looking for is the scale property on UIScreen:
https://developer.apple.com/documentation/uikit/uiscreen/1617836-scale
This allows you to control the number of pixels the coordinate system gives you per virtual pixel. iOS devices basically work at non retina coordinates. Old link explaining what is going on here:
http://www.daveoncode.com/2011/10/22/right-uiimage-and-cgimage-pixel-size-retina-display/
Don't use his macros, as some devices are now scale of 3.0, but the post explains what is going on.