How to Use Z position on NSLAYOUT Constraints in swift



The code above has 2 buttons when pressed either button is supposed to take up the full screen. The button on the right works perfectly when pressed it takes up the whole screen.

But when the button on the left is pressed the button on the right is clearly visible. I would like the code to have something that states if the button is pressed it takes the top z position.

LOOK FOR WORD TIP CALCULATOR ON THE RIGHT TOP SIDE OF THE SCREEN ON BUTTON