0
votes

In my app i am presenting a view controller on top of a view controller like this :

self.presentViewController(next, animated: true, completion:nil)

and then dismissing this view controller to come back to the first controller like this:

[self.contentViewController dismissViewControllerAnimated:YES completion:^{

    }];

but this time all the subviews i had nicely done with constraints are all messed up. Seems like the constraints between them is gone.

Although there is no specific answer i could find on google but seems like the constraints will be gone as soon as the view will disappear and you have to add it again. Is it true?

1

1 Answers

0
votes

Although there is no specific answer i could find on google but seems like the constraints will be gone as soon as the view will disappear and you have to add it again. Is it true?

If you didn't remove the constraints with [view removeConstraints:myConstraint], than the constraints will not be removed and stay forever. I only can suggest to create a new Single View Project and setup the views again. Something went wrong with your setup.