fix show info in InfoView

This commit is contained in:
nixzhu
2015-09-23 17:43:09 +08:00
committed by nixzhu
parent e0ad25dc56
commit 239bcafcfb
+8 -7
View File
@@ -11,11 +11,7 @@ import Ruler
class InfoView: UIView {
var info: String? {
willSet {
infoLabel?.text = newValue
}
}
var info: String?
private var infoLabel: UILabel?
@@ -37,8 +33,6 @@ class InfoView: UIView {
func makeUI() {
//let view = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: 240))
let label = UILabel()
label.numberOfLines = 0
@@ -61,4 +55,11 @@ class InfoView: UIView {
NSLayoutConstraint.activateConstraints(constraintsH)
NSLayoutConstraint.activateConstraints(constraintsV)
}
override func didMoveToSuperview() {
super.didMoveToSuperview()
infoLabel?.text = info
}
}