I want to programmatically change the dimensions and position of an existing button or label programmatically. The button that I want to edit is already in a ViewController and there are no constraints whatsoever in my app so far.
I have myButton instatiated with:
@IBOutlet var myButton: UIButton!
I've tried:
myButton.frame = CGRectMake(50.0, 50.0, 100.0, 50.0)
and
myButton.frame.origin = CGPoint(x: 10, y: 10)
and
myButton.frame.width = 100
The first two of these lines of code have compiled and ran, but neither have changed any of the dimensions/positions of the button. The third line of code (which I got from here) doesn't even compile because "width is a get only property."
How can I do this?