So I started to learn Programmatic UI after I struggled with Storyboard.
I basically figured out where can I store the View's code such as button, textfield, etc.
But my problem is I don't want to see all the constraints below in my VC.
Is there any way to store all these constraints somewhere or coding some function to call them every time I want to add constraints?
I know it is gonna be longer when I add more components...
For example;
func configureTextField() {
self.view.addSubview(usernameTextField)
NSLayoutConstraint.activate([
self.usernameTextField.topAnchor.constraint(equalTo: self.logoImageView.bottomAnchor, constant: 20),
self.usernameTextField.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 40),
self.usernameTextField.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -40),
self.usernameTextField.heightAnchor.constraint(equalToConstant: 50)
])
}