Fix potential crash when hit testing StatusCollapseButton
This commit is contained in:
parent
756874949a
commit
a92cf8c812
|
@ -10,7 +10,7 @@ import UIKit
|
||||||
|
|
||||||
class StatusCollapseButton: UIButton {
|
class StatusCollapseButton: UIButton {
|
||||||
|
|
||||||
private var interactionBounds: CGRect!
|
private var interactionBounds: CGRect?
|
||||||
|
|
||||||
override func layoutSubviews() {
|
override func layoutSubviews() {
|
||||||
super.layoutSubviews()
|
super.layoutSubviews()
|
||||||
|
@ -19,7 +19,7 @@ class StatusCollapseButton: UIButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
||||||
return interactionBounds.contains(point)
|
return interactionBounds?.contains(point) ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue