Ian Wise
Ian Wise

Reputation: 766

How would I go about changing to (x,y) position of an object

I'm going to try to keep this relatively simple. I have a NSImageView, and I would like to change it's (x,y) position on the screen programmatically.

How would I go about doing this?

Upvotes: 0

Views: 55

Answers (1)

Lucas Derraugh
Lucas Derraugh

Reputation: 7049

If you add one programmatically, make sure you have translatesAutoresizingMaskIntoConstraints set to false, then set the frame of the NSImageView using the frame property

imageView.frame = NSMakeRect(x, y, w, h);

Upvotes: 1

Related Questions