fir
fir

Reputation: 65

why view.center is assignable but view.frame.origin or view.frame.size are not

[sorry for my weak english]

question as stated in the title:

why view.center is assignable but view.frame.origin or view.frame.size are not :-!

it is not undesterable by me

Upvotes: 1

Views: 1083

Answers (1)

August Lilleaas
August Lilleaas

Reputation: 54593

You have to create a new one and then assign it.

view.frame = CGRectMake(1, 2, 3, 4);

// or
CGRect frame = view.frame;
frame.origin = CGPointMake(1, 2);
view.frame = frame;

// etc...
view.frame = (CGRect){1, 2, 3, 4};

Upvotes: 1

Related Questions