I add a UILabel (amountLabel) in UIViewController in storyboard editor. And then in swift file, viewDidLoad, I programatically create a
UILabel
UIViewController
viewDidLoad
let nameLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false return label }()
if you forgot setting this label.translatesAutoresizingMaskIntoConstraints = false or if you add subview after constraints this problem arises
label.translatesAutoresizingMaskIntoConstraints = false