ios – Present Disguise for UILabel over constraint not working as anticipated for top constraint

0
44


I’ve UILabel which I’m exhibiting and hiding on tapGesture.
I’ve created label programatically and set constraint programatically solely.

by default UILabel is seen with heightConstraint = 230
on tapGesture methodology I’m making heightConstraint = 0 and its hiding label appropriately.
Once more on tapGesture I would like to point out label,
so once I faucet once more, I can see heightConstraint = 230 once more, however label just isn’t seen in UI.

What could be situation, solely disguise is working and present just isn’t working.

Following is the code for tapGesture methodology the place I’m setting top constraints.

@objc func tapLabel(gesture: UITapGestureRecognizer) {
        print("faucet working")
        isExpanded.toggle()
        if(isExpanded){
            NSLayoutConstraint.activate([
                reminderBulletsLbl.heightAnchor.constraint(equalToConstant: 230)
            ])
        }else{
            NSLayoutConstraint.activate([
                reminderBulletsLbl.heightAnchor.constraint(equalToConstant: 0)
            ])
        }
    }

I attempted to deactivate the constraint however not working.

Please discover the display screen shot connected.

  1. Default state when label is seen

enter image description here

  1. On Click on, when label is hidden.

enter image description here

now after clicking once more label just isn’t exhibiting.

Thanks upfront.