In my app, I have two buttons and a timer that fires an action every second. Each second, it generates four random numbers. The numbers are used as X and Y values of the buttons, and the buttons move to the new points. However, sometimes the new points are close, so the buttons overlap. How can I check to make sure this doesn't happen? I already tried checking if CGRectIntersectsRect
of the button frames, but that does nothing.
Thanks for any help!