0

I have a little view that I would like to attach to a bigger view. When either of the views is dragged on the x axis I would like the other to move accordingly - as if they were one awkward shaped view

I tried

UIDynamicAnimator *animator = [UIDynamicAnimator alloc] initWithReferenceView:self.view];

UIAttachmentBehavior *attach = [[UIAttachmentBehavior alloc] initWithItem:firstItem attachedToSecondItem:secondItem];

[animator addBehavior:attach];

but they aren't moving like one big view :(

Avba
  • 14,822
  • 20
  • 92
  • 192
  • Why don't you add the little view as a subview of the big view? They will appear attached and the big view will obviously drag the small view. – Mika Mar 13 '14 at 15:48
  • They don't belong to each other - one is in a table view - the other is a random view – Avba Mar 13 '14 at 15:51
  • So what? They are both subclasses of UIView are they not? – Mika Mar 13 '14 at 15:52
  • That makes no sense -maybe my question is unclear - one item is a tableview cell - i want when it is dragged - that it will drag a different view in a different heirarchy – Avba Mar 13 '14 at 16:01

0 Answers0