Trying to have a label stick to another label's left side

I’m trying to make a drag and drop exercise where I have to drag a yellow box to the correct term on the other side. It should look like this at the end.

Screen Shot 2020-10-28 at 2.15.03 PM

I have an action function that moves the yellow box and when it intersects in any way it sticks.

@IBAction func dragGSV(_ sender: UIPanGestureRecognizer) {
        let theView = sender.view!
        let translation = sender.translation(in: content)
        switch sender.state {
        case .began, .changed:
   = CGPoint(x: ( + translation.x, y: ( + translation.y)
            sender.setTranslation(, in: view)
        case .ended:
            if theView.frame.intersects(tot.frame) {
                theView.isUserInteractionEnabled = false

I want theView which is my yellow box to be able to intersect the red one but only on the left side of the red one. How can I do that?

I mean not intersect but touch.

You can check out Cgrect intersects…
Which is usually done by getting the frame of the iboutlet that you connected