Revert "Add workaround for bug in iOS 11.1 beta around hit area of custom back buttons."

This reverts commit 7c82f6d448.

This wasn't helping our crash rate, and on my device, as of iOS11.1B2,
the button is easily tappable, not detectably different from prior iOS
releases.
pull/1/head
Michael Kirk 8 years ago
parent 66ab4e2549
commit f3f0d591ea

@ -1328,7 +1328,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
(OWSDisappearingMessagesConfiguration *)disappearingMessagesConfiguration (OWSDisappearingMessagesConfiguration *)disappearingMessagesConfiguration
{ {
UIBarButtonItem *backItem = [self createOWSBackButton]; UIBarButtonItem *backItem = [self createOWSBackButton];
if (backItem.customView) {
// This method gets called multiple times, so it's important we re-layout the unread badge // This method gets called multiple times, so it's important we re-layout the unread badge
// with respect to the new backItem. // with respect to the new backItem.
[backItem.customView addSubview:_backButtonUnreadCountView]; [backItem.customView addSubview:_backButtonUnreadCountView];
@ -1350,7 +1349,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
// Initialize newly created unread count badge to accurately reflect the current unread count. // Initialize newly created unread count badge to accurately reflect the current unread count.
[self updateBackButtonUnreadCount]; [self updateBackButtonUnreadCount];
}
self.navigationItem.leftBarButtonItem = backItem; self.navigationItem.leftBarButtonItem = backItem;

@ -53,22 +53,6 @@ NS_ASSUME_NONNULL_BEGIN
= CGRectMake(0, 0, backImage.size.width + kExtraRightPadding, backImage.size.height + kExtraHeightPadding); = CGRectMake(0, 0, backImage.size.width + kExtraRightPadding, backImage.size.height + kExtraHeightPadding);
backButton.frame = buttonFrame; backButton.frame = buttonFrame;
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 1)) {
// In iOS 11.1 beta, the hot area of custom bar button items is _only_
// the bounds of the custom view, making them very hard to hit.
//
// TODO: Remove this hack if the bug is fixed in iOS 11.1 by the time
// it goes to production (or in a later release),
// since it has two negative side effects: 1) the layout of the
// back button isn't consistent with the iOS default back buttons
// 2) we can't add the unread count badge to the back button
// with this hack.
return [[UIBarButtonItem alloc] initWithImage:backImage
style:UIBarButtonItemStylePlain
target:target
action:selector];
}
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton]; UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
backItem.width = buttonFrame.size.width; backItem.width = buttonFrame.size.width;

Loading…
Cancel
Save