title: Drag copy between UIViews
body: <p>I am essentially trying to do what is covered in <a href="https://stackoverflow.com/questions/3842447/drag-uiview-between-uiviews">this question</a>, but copy instead of move.</p>
  
  <p>Here is what the view hierarchy looks like (copied from the existing question). <strong>A</strong> and <strong>B</strong> are both inside a common superview. <strong>X</strong> is a view inside <strong>A</strong>.</p>
  
  <pre><code>  A        B
  _____    _____
  |   |    |   |
  | X | -&gt; |   |
  |___|    |___|
  </code></pre>
  
  <p>I want to copy <strong>X</strong> into <strong>B</strong>. <strong>A</strong> is a list of available items. I want to choose an item from <strong>A</strong> and add a copy of it to <strong>B</strong>.</p>
  
  <p>This is what I have come up with so far. After detecting a touch in <strong>X</strong>, I make a copy of the view (viewCopy). Then I add viewCopy to A and add the original view to the superview of <strong>A</strong> and <strong>B</strong>. This is because the touches are probably active on the original view and not on the copied view. I want the new (copied) view to respond to drag for a smooth transition from <strong>A</strong> to <strong>B</strong>.</p>
  
  <pre><code>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
  {        
      id viewCopy = [self mutableCopy];
      [self.superview.superview addSubview:self];
      [self.superview addSubview:viewCopy];
      [viewCopy release];
  }
  </code></pre>
  
  <p>This obviously does not work. It is a very crude try, but I am not sure how to go about doing this. Any help would be great. Thanks.</p>