Instead of subclassing or overriding the drawing functions, I decided to overlay images on the image with transparency in the visible part. those. if my "surface" was an image of parchment, and I intended to draw a bunch of images on it. I will have a parchment image, then a UIView container for any images that will be placed on this parchment, then a mask image on top of that which was the original parchment image, but with parchment converted instead to full transparency, and the surrounding area remains exactly as the background on which the parchment is on (then all the other widgets of the user interface on top of this).
, , - ( ).