I have a UIView that a user can add subviews to. I now need the application to automatically place a subview for the user at the first found open location.
A location is considered open if the frame of the subview to be placed does not intersect any other subviews.
The calculation to locate this open area does not need to be instant - it will run when the user first enters a scene, at which point it saves that location as if it were the user that placed it.
The container UIView will be large enough to ALWAYS have an open space to place the subview (there are a limited number of subviews that the user can add).
What would be the simplest way to determine a location to place the subview?