I'm using AutoLayout for my app designing. For one of my HeaderView, I had set it's height using AspectRatio.
Now when main view does not contain any data then HeaderView height should be 0 and when data is added it should be again set to the original aspect ratio.
Can we change the aspect ratio as we change the constant value of any constraint. I tried below code, but it's not working properly.
@IBOutlet weak var constOptions_Height: NSLayoutConstraint!
if arrData.count == 0 {
constOptions_Height.constant = 0.0
}
else{
constOptions_Height.constant = 50.0
}