See if this helps you get started.
So apple2 is draggable and apple is the target.
If when you stop dragging apple2, if it is touching apple, apple2 will snap to apple's origin.
If apple2 isn't touching apple when it is dropped apple2 goes back to its original position.