I just updated my device to iOS to test my app in preparation for iOS 11. I have a toolbar at the top that no longer seems to have buttons working - the images worked fine in iOS 10 and below.
Here's how I initialize the images:
@property (strong, nonatomic) IBOutlet UIToolbar *navBar;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *refreshButton;
path = [NSString stringWithFormat: @"https://s3.amazonaws.com/myapp/images/refresh.png"];
url = [NSURL URLWithString:path];
data = [NSData dataWithContentsOfURL:url];
refreshButton = [[UIImage alloc] initWithData:data];
smallerButton = [TRUtils imageWithImage:refreshButton scaledToSize:CGSizeMake(20, 20)];
//TODO: Check image exists
self.refreshButton = [[UIBarButtonItem alloc] initWithImage:[smallerButton imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
style:UIBarButtonItemStylePlain
target:self
action: @selector(refreshButtonPushed:)];
[self.refreshButton setTarget:self];
self.refreshButton.enabled = YES;
self.refreshButton.imageInsets = UIEdgeInsetsMake(32, 32, 32, 32);
Then I add them to the navbar here:
self.navBar.items = [NSArray arrayWithObjects:self.backButton, self.forwardButton, self.flex, self.toolbarTitle, self.flex, self.refreshButton, self.flex, self.homeButton, nil];
Any idea why the images would stop showing in iOS 11 but display just fine in iOS 10?
It seems like the buttons still "work" but they just are blank spaces so people wouldn't know they are available.
It seems like this SO has a solution to fix it. But when I set:
self.navigationController.interactivePopGestureRecognizer.delegate = self;
and
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)] &&
gestureRecognizer == self.navigationController.interactivePopGestureRecognizer) {
return NO;
}
return YES;
}
The issue still occurs.