Actually, layoutIfNeeded() is only necessary when you want immediate layout. setNeedsLayout() is sufficient if you can wait for the next drawing cycle.
By the way, who else thinks it's weird that it doesn't look like a layout issue--i.e. relative positioning and size related--but setting the layout flag works? I called setNeedsDisplay() thinking redrawing the view will apply opacity changes, but it didn't work.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: