I add a UILabel (amountLabel) in UIViewController in storyboard editor. And then in swift file, viewDidLoad, I programatically create a
UILabel
UIViewController
viewDidLoad
Make sure you added the paymentTextField to your view:
paymentTextField
paymentTextField.translatesAutoResizingMaskIntoConstraints = false view.addSubview(paymentTextField) ...
Add your constraints, for example paymentTextField.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
paymentTextField.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true