I usually use NSLayoutAnchor but many times I have been advised to not use it. Is there any problem with it such as performance drop besides more complex/longer code?
I've been told to use:
let myView = UIView(frame: CGRect(x: 0, y: 20, width: view.frame.bounds.width, height: 100))
Instead of:
let myView = UIView()
myView.translatesAutoresizingMaskIntoConstraints = false
myView.widthAnchor.constraint(equalTo: view.widthAnchor).isActive = true
myView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
myView.topAnchor.constraint(equalTo: view.topAnchor, constant: 20).isActive = true
myView.heightAnchor.constraint(equalToConstant: 100).isActive = true