I want to remove the text from the back button, but I want to keep the icon. I have tried
let backButton = UIBarButtonItem(title: \"\", style: UIBarButtonIt
If you wanted to remove the title of a back button from a pushed view controller, let's say < in subSettingsViewController then you've to set backBarButtonItem title in SettingsViewController's viewWillDisappear() method.
Objective-C:
- (void)viewWillDisappear:(BOOL)animated
[super viewWillDisappear:animated];
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:self.navigationItem.backBarButtonItem.style target:nil action:nil];
}
Swift:
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
}