The navbar button for the rep/activity log can't be tapped when displaying a rating change (+5).
Persists between app runs.
- App Version: 1.6.2.5
- Device: iPhone 5 (Global)
- OS Version: Version 10.2 (Build 14C92)
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityThe navbar button for the rep/activity log can't be tapped when displaying a rating change (+5).
Persists between app runs.
This will be fixed in 1.6.3.3, shipping this month.
Before 1.6.2, we were serving a UIButton as the bar button item's custom view when we showed a reputation change. This was causing bugs so we used a UIView as the custom view and put both button modes in it. I'm guessing the internal logic of the navigation bar is such that buttons and button custom views are given a large hit radius, but contents of custom views aren't.
I've overridden point(inside:with:)
for both the buttons and the custom view so any tap in the navigation bar to the right of the button's left edge is a hit:
Before
After
Code
private class AchievementButton: UIButton {
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
guard let navigationBar: UINavigationBar = nextOfReturnedType() else {
return super.point(inside: point, with: event)
}
// The achievement button is always the last one. We check that the point is at least the left edge and inside the navigation bar.
return point.x >= bounds.minX && convert(navigationBar.bounds, from: navigationBar).contains(point)
}
}
private class AchievementCustomView: UIView {
// Defer to the button.
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
for view in subviews {
if view.point(inside: view.convert(point, from: self), with: event) {
return true
}
}
return false
}
}