How do I achieve this kind of button? Can I do using navigation bar ?
Asked
Active
Viewed 120 times
0
-
1If settings is parent view title, by default it will show like this when using UINavigationBarController. If you need to customize, check this question http://stackoverflow.com/questions/18870128/ios-7-navigation-bar-custom-back-button-without-title – Dileep Mar 11 '15 at 10:13
3 Answers
1
You have to use a UINavigationController
. Each time you push a new view controller using:
self.navigationController?.pushViewController(controller, animated: true)
the new controller gets a back button with the previous controller in the stack name.

Nikos M.
- 13,685
- 4
- 47
- 61
-
-
I do not see a reason why not using view controllers with navigation controller in order to push views with back functionality but if you want to put it in a uiview you have to implement a custom UIButton and make it look like the default back button. – Nikos M. Mar 11 '15 at 10:44
0
Yes you can by giving navigation title in you setting view controller.
self.navigationItem.title = @"Settings";

Suyash Seth
- 85
- 1
- 10
-1
yes you can achieve this by navigationBar. it is very easy in implement by UINavigationBar.
Objective C
// Set this in every view controller so that the back button displays back instead of the root view controller name
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
Swift
self.navigationItem.backBarButtonItem = UIBarButtonItem(title:"", style:.Plain, target:nil, action:nil)

SGDev
- 2,256
- 2
- 13
- 29