Do you have to explicitly call setNeedsDisplay after calling setFrame on UIView as shown in the following cases?
view1.frame = frame;
[view1 setNeedsDisplay];
[view2 setFrame:frame];
Short answer: No
You call setNeedsDisplay when you need method drawRect to be called, and according to UIView Class Reference.-
Changing the frame rectangle automatically redisplays the receiver without invoking the drawRect: method. If you want the drawRect: method invoked when the frame rectangle changes, set the contentMode property to UIViewContentModeRedraw.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With