iPhone -- the input parameter to UIView's sizeThatFits method

Viewed 9131

The signature of this method is:

- (CGSize)sizeThatFits:(CGSize)size

I don't understand what the size parameter is used for. Apple's documentation states that it is "The current size of the receiver."

But the receiver presumably knows its current size. So why does it need to be passed in?

When I experimentally pass in other values, the method appears to use the receiver's current size anyway.

Can anyone explain? And is there any case where this parameter matters?

2 Answers
Related