0

I have a some movable views in the user interface and I need to know if the moving view's frame touched any of the other view's frame and if touched I need to merge these two views into a single view.

i have added a sample image down here enter image description here

PRAVEEN K.P
  • 101
  • 1
  • 12
  • Possible duplicate of http://stackoverflow.com/questions/7361750/detecting-if-uiview-is-intersecting-other-uiviews – Tom Susel May 21 '14 at 09:30

1 Answers1

1

You can useCGRectIntersectsRect method. Get the bounds of two views and use this method

rect1 = self.view1.bounds;
rect2 = self.view2.bounds;

CGRectIntersectsRect(CGRect rect1, CGRect rect2)
Anil Varghese
  • 42,757
  • 9
  • 93
  • 110