Problem with Spritekit and generating a movable ImageView

Hello, I am having a problem with my app. I am trying to let the user create an imageView when they click a button and then allow that imageView to be movable. Basically, I want users to be able to move characters around like for blocking a camera shot or something (for directors). However, when the imageView is created, and I try to move it, for some reason it only recognizes my touch when I touch the screen about an inch to the right and an inch below the image. Normally, when you hold down on a image it follows your finger, but in my app that only works if you hold your finger on a blank space a few inches away from the image. So basically you end up moving the image, but it’s about an inch from your finger. I’m not sure if I’m explaining this correctly, but here is my code (part of it). I have touchesBegan and touchesEnded as well but they have the same exact code as touchesMoved. Any help would be greatly appreciated! Also, is there a simple way I can confine these movable objects in my app to a certain larger imageView? In other words, I don’t want the user to move the character or object to the edge of the screen but just to the edge of an imageView that covers a large part of the screen. Thanks in advance!

    override func viewDidAppear(_ animated: Bool) {
        
        observer = NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: "createThatCharacter"), object: nil, queue: OperationQueue.main) { (notification) in
            
            // Create an imageView to house a character object
            self.imageView = UIImageView(frame: CGRect(x: 150, y: 150, width: 50, height: 50))
            
            // Put the character image into the imageView
            self.imageView.image = UIImage(named: "character")
            self.imageView.contentMode = .scaleToFill
            
            // Append the imageView to an array of character imageViews
            characterArray.append(self.imageView)
            
            self.view.addSubview(self.imageView)
        }
    }
  override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
        for touch in (touches) {
            
            let location = touch.location(in: sandboxImageView)
            
            for image in characterArray {
                if image.frame.contains(location) {
                    image.center = location
                }
            }
            for image in objectArray {
                if image.frame.contains(location) {
                    image.center = location
                }
            }
        }
    }

image

Basically, if I clicked right where my cursor is in the picture, I can move the circle. However, the circle stays that same distance away from the cursor. Also, if I try to actually hold down on the circle and move it, nothing happens. The above explanation sounded confusing rereading it.

i think theres something wrong here, try to debug by printing that the value of location is, and what “contains” actually checks for

Thanks!!
I used the print statements and found that this line was the issue:

let location = touch.location(in: sandboxImageView)

I should have done (in: view) instead of (in: sandboxImageView)
As for my other question: it is likely a very easy solution, but how do I make it so that these movable objects cannot be moved out of a certain image view? I have some buttons on the side, and I don’t want the user to be able to move the objects over the buttons. Thanks!

maybe just have it check the location it stopped, if it stopped at the button location (hardcode it) then it should give an error and maybe a new location just beside the button

Thanks! I did end up hardcoding it.