let loginView: UIButton = {
let button = UIButton(type: .system)
button.setTitle("Войти", for: .normal)
button.setTitleColor(.white, for: .normal)
button.backgroundColor = UIColor(named: "BackgroundInputColor")
button.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold)
button.layer.cornerRadius = 13
button.layer.masksToBounds = true
button.configuration!.contentInsets = NSDirectionalEdgeInsets(top: 2, leading: 15, bottom: 2, trailing: 15)
button.translatesAutoresizingMaskIntoConstraints = false
return button
}()
view.addSubview(loginView)
loginView.translatesAutoresizingMaskIntoConstraints = false
let trailingConstraint = loginView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -8)
NSLayoutConstraint.activate([
loginView.topAnchor.constraint(equalTo: menuView.topAnchor),
trailingConstraint,
loginView.heightAnchor.constraint(equalToConstant: 37)
])