You are stuck on designing UI as it doesn't work like the way you wanted it to and some views simply doesn't appear on screen when you run the app. You have spent 3 hours making all the red lines turn into blue in Interface Builder by now.
Here is a checklist to troubleshoot why it is not working :
- If you are adding UIView through code, have you set
view.translatesAutoresizingMaskIntoConstraints = false?
- Did you put enough constraints so that the Auto Layout is able to calculate each of the views position and size ?
- If you are adding constraint using code, did you activate the constraints AFTER you place the view in parent view ? eg:
// add the programmatically created view to its parent before activating constraints parentView.addSubview(childView) ... NSLayoutConstraint.activateConstraints([childBottomConstraint])
- Is there any hidden conflicting constraint? Try to switch between different device in the Interface Builder and see if theres any red line with numbers