I am trying to set the origin of the frame programmatically.
Method1:
button.frame.origin.y = 100;
Method 2:
CGRect frame = button.frame;
frame.origin.y = 100;
I tried method 1 but it is not working(showing an error saying Expression is not assignable). Method 2 is working. Why is this so?
Need guidance on what I am doing right.