DM
Size: a a a
DM
АЗ
V
A
extension UIView {
func show() {
let view = UILabel()
view.text = "TEST"
view.backgroundColor = .red
view.translatesAutoresizingMaskIntoConstraints = false
self.addSubview(view)
let topConstraint = view.topAnchor.constraint(equalTo: self.topAnchor); topConstraint.isActive = true
view.heightAnchor.constraint(greaterThanOrEqualToConstant: 50).isActive = true
view.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 10).isActive = true
view.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -10).isActive = true
self.layoutSubviews()
topConstraint.constant += self.safeAreaInsets.top + 10
UIView.animate(withDuration: 3, animations: {
self.layoutIfNeeded()
})
}
}
DM
DM
V
V
extension UIView {
func show() {
let view = UILabel()
view.text = "TEST"
view.backgroundColor = .red
view.translatesAutoresizingMaskIntoConstraints = false
self.addSubview(view)
let topConstraint = view.topAnchor.constraint(equalTo: self.topAnchor); topConstraint.isActive = true
view.heightAnchor.constraint(greaterThanOrEqualToConstant: 50).isActive = true
view.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 10).isActive = true
view.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -10).isActive = true
self.layoutSubviews()
topConstraint.constant += self.safeAreaInsets.top + 10
UIView.animate(withDuration: 3, animations: {
self.layoutIfNeeded()
})
}
}
V
ЕУ
A