Fix crash when displaying new status cells with polls

This commit is contained in:
Shadowfacts 2022-10-08 15:12:17 -04:00
parent 5b116c0d4e
commit 0fee770411
1 changed files with 11 additions and 9 deletions

View File

@ -38,9 +38,17 @@ class StatusPollView: UIView {
optionsView.isTracking
}
override func awakeFromNib() {
super.awakeFromNib()
override init(frame: CGRect) {
super.init(frame: .zero)
commonInit()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}
private func commonInit() {
backgroundColor = .clear
optionsView = PollOptionsView(frame: .zero)
@ -55,12 +63,6 @@ class StatusPollView: UIView {
infoLabel.adjustsFontSizeToFitWidth = true
addSubview(infoLabel)
// voteButton = UIButton(type: .system)
// voteButton.translatesAutoresizingMaskIntoConstraints = false
// voteButton.addTarget(self, action: #selector(votePressed), for: .touchUpInside)
// voteButton.setTitle("Vote", for: .normal)
// voteButton.setTitleColor(.secondaryLabel, for: .disabled)
// voteButton.titleLabel!.font = infoLabel.font
voteButton = PollVoteButton()
voteButton.translatesAutoresizingMaskIntoConstraints = false
voteButton.addTarget(self, action: #selector(votePressed))