我在UIButtons
中有两个ViewController
。其中一个可以使用UIPanGesture
识别器进行拖动。我想将此可拖动的UIButton
放在固定的UIButton
上。我怎样才能做到这一点?
这就是我的尝试:
if (CGRectIntersectsRect(self.firstButton.frame, self.oneButton.frame))
{
[self.oneButton addSubview:self.firstButton]; //first button is the dragable button.
}
但是我认为只是添加子视图不起作用。实现这一目标的正确方法是什么?