Reputation: 101
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
Upvotes: 0
Views: 112
Reputation: 42977
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)
Upvotes: 1