I am changing some constraints and hiding some elements on a certain VC depending on what device the user is using.
Like this:
override func viewDidLayoutSubviews() {
if Iphone6 == true {
self.view.layoutIfNeeded()
self.someConst.constant = 70
self.anotherConst.constant = 67
self.someButton.hidden = true
self.someView.hidden = true
self.view.layoutIfNeeded()
}
}
Now I wonder if I need to call layoutIfNeeded()
twice in viewDidLayoutSubviews
?
I do know that you have to call layoutIfNeeded() twice if you are using animateWithDuration
when changing constraints but this it also apply to viewDidLayoutSubviews?
Thanks,