I have a view that contains some objects like this (the green area is my view): 
[![enter image description here](https://i.stack.imgur.com/Ncz5E.jpg)](https://i.stack.imgur.com/Ncz5E.jpg)

Every time I press "item" a new color object gets added to this row of views, I want the "row" button to copy this row as it is and place it above this row when pressed, so I have two (or multiple) rows on top of each other. I made the action for row button like this:

```
    let hc = contentView1
    hc?.setFrameOrigin(NSPoint(x: 0, y: (positionY*50)))
    positionY += 1

    contentView2?.addSubview(hc!)

```

but every time I press that button, the same row just moves and does not copy, like this: 

[![enter image description here](https://i.stack.imgur.com/MfDKw.jpg)](https://i.stack.imgur.com/MfDKw.jpg)

What am I doing wrong?