我正在动态创建按钮UIView
。我可以使用此代码通过拖动来移动它们
- (IBAction)draggedOut: (id)sender withEvent: (UIEvent *) event: (NSSet *)touches {
UIButton *selected = (UIButton *)sender;
selected.center = [[[event allTouches] anyObject] locationInView:hallView];
}
我可以有多个按钮。当我拖动某个按钮时,我需要检查是否与其他按钮有任何交集?
我怎样才能做到这一点?