SlideOutMenu remove Navigation Bar - uinavigationcontroller

I use SWRevealViewController for my project. Currently, the problem is that when the project starts, Navigation bar show with title of "MyApp". But, navigation bar disappears when I click on Home
If I add a Navigation Bar in view controller, there will be 2 navigation bars at first run. One navigation will automatically disappear when I click on Home link.
How to do to get the first image appearance when I click on Home link? I'm using Swift 3.

You could try set the navigation bar to not hidden in the viewWillAppear.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: false)
// ...
}
However I presume the reason the navigation bar is hidden is because the controller is being presented modally and not being pushed onto the main navigation controller. If this is the case, then you will need to probably do something with the SWRevealViewController and push the controller onto the main navigation controller.
Check out the Basic API usage for SWRevealViewController here and here is an alternative that has codeless storyboard implementation and is very easy to configure.

(Posted on behalf of the OP).
I'm not sure the way I solved is right or wrong. But, it works for me.
I remove default Navigation Bar by disabling the bar visibility. Then, I add new Navigation Bar in Home page. After I run the app, my new Navigation Bar appears when I press on the Home button.

Related

How to navigate to a new Screen when using SideBarController in Xamarin.iOS

I have an application with a lot of screens, let say HomePage, Section Screen and Detail Page, Category Screen.
I use a NavigationController to Navigate from HomePage to Section Screen.
In the SectionScreen I have used a SideBarController component (https://components.xamarin.com/view/sidebarnavigation) to implement a navigation drawer or a flyout menu.
The problem is how to navigate from Section Screen to Detail Page or to Category Screen. I need to make this kind of navigation from MenuController or ContentController.
I don't want to just change the contentView. I want to push another UIViewController.
I have used the usual one:
this.NavigationController.PushViewController( new UIViewControllerExample(), true);
but there are some problems:
In the details page I can't access the NavigationBar
When I press back, the app crashes with an error:
Cant add self to subview
This is how to it should look like.
This is the problem. The first image display what happen when i use the above code,
Any idea how to solve this.
as you can find in that page of component you should use SidebarController as your navigationcontroller
SidebarController.ChangeContentView(new OtherContentController());

Switch back from view to tab bar view

I am trying to learn how to work with Xcode 4.5.
I have created a tab bar and would like to switch from one of the tab bar views (profile) to another view (settings -not within the tab bar menu), and back. I use below code to go to the:
- (IBAction)goToProfile:(id)sender {
ProfileViewController * profile = [[ProfileViewController alloc] initWithNibName:nil bundle:nil];
[self presentViewController:profile animated:YES completion:nil];
It works fine to go to settings, but when I go back from settings view to Profile, the tab bar menu is gone. How can i go back to profile view and see the tab bar again?
I had the same problem. You can either fix it with some code or you can just make some changes in your storyboard.
If you Put a Navigation Controller between your Tab Bar Controller and the View of your selected Tab (Profile in your case). If you use a push segue to go to the next View it will take the Tabbar to the next view and also a "Back" Button. (Settings in your case)
Here's an example of my App my jubla3ForthViewController would be your ProfileViewController and one of my jubla3PDFOnlineViewControllers would be your SettingsViewController.
http://www.abload.de/image.php?img=bildschirmfoto2013-01x2kti.png
(im not allowed to post direct images because of my low reputation points)
I hope this was usefull. If it was don't forget to push the up Arrow.

How to identify the viewcontroller is clicked from More Tab or Separate tab in UITabBarController?

I have the navigationcontroller based viewcontroller and I overriding the root view controller navigation bar back button in to my custom segment control with different purpose. This navigation controller is placed one of the separate tab in the uitabbarcontroller. If this is used as the separate tab bar then no problem.
But if i use this navigationcontroller inside the more option in tabbarcontroller i am not able to come back to the more option list because of backbutton is overridden in my navigationcontroller.
My idea is add one back button only if my navigationcontroller is used more option tab otherwise i need to hidden the back button.
Please help me in this issue?
You can check if a view controller is in the 'more' section as follows:
BOOL isOnMoreNavigationController = [tabBarController.moreNavigationController.viewControllers containsObject:myViewController.navigationController];
From a UI consistency perspective it might be better to always show the back button in its standard position and move your custom buttons to some other place.

UINavigationController custom titleView

I have a navigation controller with a root view controller for which i have the customised titleView instead of normal title for the navigation item.
If i pushed a new controller in it , the default back button title is "back", Since i have used custome titleView.
I want it to be different. I tried by setting the title in backbaritem of the root view controller, but no use.
I can create a bar button item in my pushed controller and i can set it as leftbar item, But i want it like a normal back button. [Pointing towards backward]
Is it possible to set title for the back button , if i have a custom titleView ?
Is it possible to create a bar button item as like as default back button.[Pointing towards back , other than plain,border...etc] ?
Regards,
Balaji R.
I got it.
Even though i have custom titleView for my navigation item, I can still set the title for the same navigation item where it wont be taken for the title display in navigation item . but it will taken as the title of the back button when some other controllers are pushed into it.
So , Now i'm having both title [Used for back title display] and titleView [custom view] in the navigation item.
Thanks,
Balaji R.

Problem in using tab bar controller with navigation controller

I am working on a navigation based application. I am using navigation controller for this purpose. I want to use tab bar on one of the screens and i am not able to find any way of doing this. As far as i have read, it is not possible to add tab bar controller when you are using navigation controller. Is it right? One solution was to manually add a tab bar on the screen and write its delegate class but in this solution, I will lose "More" button functionality because this thing is handled by tab bar controller itself. Does anyone has any solution to my problem? Please help!!!
You can add a UINavigationController to each of the UITabBarController's tab views but not the other way around.
According to Apple's documentation you cannot push a UITabBarController on top of the UINavigationController. I'm not sure if that is a technical limitation or if they will reject your application when you submit. Either way you shouldn't try to do this.

Resources