Added the following two function from UINavigationItem-iOS7Spacing
- (UIBarButtonItem *)spacer
{
UIBarButtonItem *space = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
space.width = -11;
return space;
}
- (BOOL)isIOS7
{
return ([[[UIDevice currentDevice] systemVersion] compare:@"7" options:NSNumericSearch] != NSOrderedAscending);
}
And then used the following inside loadView -
UIBarButtonItem* clearItem = [[UIBarButtonItem alloc] initWithCustomView: clearButton];
if ([self isIOS7]) {
self.navigationItem.rightBarButtonItems = @[[self spacer],clearItem];
}
else
{
self.navigationItem.rightBarButtonItem = clearItem;
}
Worked Flawlessly
Thank you all for your help!