fix: check if isFirstTimeBeenAddAsSubview to makeUI

This commit is contained in:
nixzhu
2015-06-24 17:16:09 +08:00
parent 708be684ee
commit d37b75ae25
@@ -18,6 +18,7 @@ class ConversationMoreDetailCell: UITableViewCell {
layoutMargins = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
textLabel?.textColor = UIColor.darkGrayColor()
textLabel?.font = UIFont(name: "Helvetica-Light", size: 18)!
}
required init(coder aDecoder: NSCoder) {
@@ -33,6 +34,7 @@ class ConversationMoreCheckCell: UITableViewCell {
layoutMargins = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
textLabel?.textColor = UIColor.darkGrayColor()
textLabel?.font = UIFont(name: "Helvetica-Light", size: 18)!
makeUI()
}
@@ -188,10 +190,19 @@ class ConversationMoreView: UIView {
})
}
var isFirstTimeBeenAddAsSubview = true
override func didMoveToSuperview() {
super.didMoveToSuperview()
makeUI()
if isFirstTimeBeenAddAsSubview {
isFirstTimeBeenAddAsSubview = false
makeUI()
let tap = UITapGestureRecognizer(target: self, action: "hide")
containerView.addGestureRecognizer(tap)
}
}
func makeUI() {