ДЛЯ КОНТРОЛЯ ПРОСМОТРА:
ПРОВЕРЬТЕ ИЗОБРАЖЕНИЕ.:
ДЛЯ ОГРАНИЧЕНИЙ ЭТИКЕТКИ:
ПРОВЕРЬТЕ ИЗОБРАЖЕНИЕ.:
КОД
override func viewDidLoad() {
let subview = UIView()
subview.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(subview)
//SET VIEW Constarins
subview.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 50).isActive = true
subview.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 25).isActive = true
subview.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: 25).isActive = true
let lblValue = UILabel()
lblValue.text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum"
lblValue.numberOfLines = 0
lblValue.lineBreakMode = .byWordWrapping
lblValue.translatesAutoresizingMaskIntoConstraints = false
subview.addSubview(lblValue)
//SET LABEL Constarins
lblValue.topAnchor.constraint(equalTo: subview.topAnchor, constant: 0).isActive = true
lblValue.leadingAnchor.constraint(equalTo: subview.leadingAnchor, constant: 0).isActive = true
lblValue.trailingAnchor.constraint(equalTo: subview.trailingAnchor, constant: 0).isActive = true
lblValue.bottomAnchor.constraint(equalTo: subview.bottomAnchor, constant: 0).isActive = true
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}