Why a frame of a UIView is not updating in ViewDidLayoutSubviews?
I've had the same problem. Forcing the layouting for your view's superview helped me out:
-(void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
[self.bottomView.superview setNeedsLayout];
[self.bottomView.superview layoutIfNeeded];
// Now modify bottomView's frame here
}
In Swift:
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
bottomView.superview!.setNeedsLayout()
bottomView.superview!.layoutIfNeeded()
// Now modify bottomView's frame here
}
Believe it or not the below code fixed it
override func viewDidLayoutSubviews() {
DispatchQueue.main.async {
// UI changes
}
}