Kích thước view truy cập qua view.frame.size (width, height).
@IBOutlet var sampleView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
print(sampleView.frame.size) // in ra (width, height)
}
Lưu ý: frame tính theo tọa độ superview, bounds là tọa độ nội bộ.