From f274bb0c14b13e0e7bbf65fc5a07f40fcaa482cc Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 15 Feb 2017 01:58:44 -0800 Subject: Hide custom function_ as an implementation detail. --- CyteKit/WebViewController.h | 1 - CyteKit/WebViewController.mm | 15 ++++----------- 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'CyteKit') diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h index c8630d9..20fe475 100644 --- a/CyteKit/WebViewController.h +++ b/CyteKit/WebViewController.h @@ -121,7 +121,6 @@ - (void) customButtonClicked; - (void) applyRightButton; -- (UIBarButtonItem *) customButton; - (UIBarButtonItem *) rightButton; - (void) applyLeftButton; diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 18b40d9..4f11b5d 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -793,9 +793,9 @@ float CYScrollViewDecelerationRateNormal; - (UIBarButtonItem *) customButton { if (custom_ == nil) - return nil; + return [self rightButton]; else if ((/*clang:*/id) custom_ == [NSNull null]) - return (UIBarButtonItem *) [NSNull null]; + return nil; return [[[UIBarButtonItem alloc] initWithTitle:static_cast(custom_.operator NSObject *()) @@ -848,14 +848,7 @@ float CYScrollViewDecelerationRateNormal; [self applyLoadingTitle]; } else { [indicator_ stopAnimating]; - - UIBarButtonItem *button([self customButton]); - if (button == nil) - button = [self rightButton]; - else if (button == (UIBarButtonItem *) [NSNull null]) - button = nil; - - [[self navigationItem] setRightBarButtonItem:button animated:YES]; + [[self navigationItem] setRightBarButtonItem:[self customButton] animated:YES]; } } @@ -920,7 +913,7 @@ float CYScrollViewDecelerationRateNormal; initWithTitle:(kCFCoreFoundationVersionNumber >= 800 ? @" " : @" ") style:UIBarButtonItemStylePlain target:self - action:@selector(reloadButtonClicked) + action:@selector(customButtonClicked) ] autorelease]; UIActivityIndicatorViewStyle style; -- cgit v1.2.3