Right navigation item disappear when pushes JASidePanels - ios

I am using the JASidePanels as submodule and I wanted to know if there is a way to keep the right icon on the navigation bar always visible and working.
For now I have my center panel which is a table view, and both left and right panels works.
But when I click a table view cell, it pushes a viewcontroller on it but the JASidePanel controls are lost... I cant slide it to the left to see my right panel.
Yes, I know that the left button will be replaced with the back button. This one is fine for me, I just care about the one on the right.

UINavigationController presents UIViewController (and subclasses). Each UIViewController is associated with an UINavigationItem that contains the information about the tool bar items and navigation bar items. This information is only used when that particular view controller is presented in a UINavigationController. If you want to put a button from viewController 1 in viewController 2, you need to assign the button to the UINavigationItem instance of viewController 2. Note that, if the action:target receiver for the button action is not viewController 1, you can easily create the UIBarButtonItem instance with the same characteristics in viewController1 for viewController2's UINavigationItem instance in viewController2's viewDidLoad method.

Related

Add a right button to a nested view in a UINavigation stacking using Storyboards

Lets say we have a UIViewController embedded in a UINavigationController, the UIViewController segue to another UIViewController.
The second UIViewController has the standard left navigation button that "unwinds" to the previous UIViewController.
I don't seem to be able to add a righthand button (using a UIBarButtonItem) to the navigation bar of the second UIViewController via the Storyboard, when I attempt this the button ends up creating a tab bar at the bottom of the UIViewController (see below, notice also the left buttons are missing). Is there some trick I am missing?
I could embedded the second UIViewController in its own UINavigationController but then I loss the back button functionality.
I know it is possible to add the button in code so all is not lost if I am attempting something that isint possible.
To do this in the Storyboard, you need to place a UINavigationItem onto your UIViewController. Then you can add your UIBarButtonItem(s).

Inside a UITabBarController how do I segue from one view controller to another and retain the tab bar?

I drag a UITabBarController from Object library to the storyboard.
From firstViewController I want to swipe to another viewController named CustomController using a swipe gesture recognizer and retain the tab bar on CustomController when it is instantiated.
The problem is that once the segue is performed from firstViewController to CustomController, the tab bar no longer shows at the bottom of Custom Controller and it does not swipe back to firstViewController.
This is the outcome I would like to achieve. Please advise best route.
You can use ContainerView to view your view controller. when you
click on segment 1 you can set your firstviewcontroller to
containerview and when you click on segment 2 you need to replace customviewcontroller in containerview. you do like this you will not lose your tab bar viewcontroller. For Swipe gesture, you
can add it later if you want. Hope this can help you.

Back button does not appear in viewcontroller

I wish to simply add a back button to the view controller, when accessed from a TableView in my app.
I have embedded the resulting ViewController within the navigation controller, and the back button is simply supposed to appear as documentation notes, but it does not...
Remove the UINavigationController between FriendsViewController and IndividualChatController.
When you push a new navigationController, it creates a new navigation stack with its own navigationBar and therefore you don't see a back button in the navigationBar

How to change view controller's title in storyboard

I have a ViewController, which is connected to a UINavigationController, that has two buttons, each one for a specific UITableViewController.
I drag and drop from each button to its corresponding UITableViewController and select show for the seque
the problem is that I can tap on the top of the first UITableViewController and set the name, but I can't do that on the second UITableViewController. my question is that normal?
please notice that the second UITableViewControlelr (Subtitle Cell Table View Controller) doesn't have a come back symbol like the other two do
as I am totally aware that I might need to wait because on swift still not a lot of programmers as in Android, i hope you help me
Updat3 1
I will add screenshot to show you my problem
this is the MainViewController
This is the first UITableViewController (as you see it has a title, which is players)
This is the second UITableViewController (my problem is here I couldn't add a title for it by clicking on the sense on my storyboard)
You need to drag a UINavigationItem into UITableViewController.
Navigation item belongs to a view controller and it is used to show the view controller title on the navigation bar. Every UIViewController has a Navitagtion item assigned to it. Its generated at runtime.
When a View Controller is pushed onto a Navigation Controller, the navigation controller gets the information for title view form the view controllers's Navigation Item.
So if you want to be able to change the title of a View Controller from storyboard, you need to add a Navigation Item in ViewController.
UINavigationController cannot have title changed, because, title belongs to ViewController, and navigation controller just show the relevant title onto its navigation bar.

How to create a UIView with NavigationBar and TabBar

I would like to introduce in my app a View that will contains both navigation bar and a tab bar at the bottom. View contains a Table View with multiple entries and once user tap on a cell a push segue takes him to another view with details regarding the cell he has previously tapped. If he decides, user can go back to parent view by tapping on 'Back' button of the navigation bar on top. In addition to this, I would like my view to have a tab bar at the bottom with extra tools for the user. So, if he decides to check the 'Creator' of the app, he can by simply tap on 'Creator' TabBarItem at the bottom.
I would like to ask you what is the best way to achieve the above. I have already tried to use UITabBarController combined with UINavigationController. Didn't achieve what I was looking for because I would like the view with the table on it to be independent from the TabBarController and NOT a part of it (by part I mean by accessible through tabs).
Do you believe a UINavigationController view with UITabBarView would be a better choice?
UPDATE
What I mean by, "independent from the TabBarController and NOT a part of it":
Once the app loaded, I would like to see my main view (with table) contains Navigation Bar on top and Tab Bar at the bottom. However, I don't want to see the first tab of the Tab Bar selected because my main view will not be accessible through tabs of the Tab Bar but through Navigation Bar. If, for example, I am in Main view and tap on 1st tap, I would like to move to another view that will contains some other info.
Option 1:-
Create a tab bar Controller and on that TabbarController assign your navigation Views.
say nav1 with tab1 , nav2 with tab2...
Option 2:-
Create a Navigation View Controller and than add the tabbarcontroller on that navigationView Controller by using addSubView.
So when the user clicks on a row in a table u will go to a different View which doesn't have the TabbarController and when the user comes back he will again see the TabbarController.
This is what I will do:
First I will subclass UITabbarController and create for example ParentTabBarController. This controller will contain all the tabs necessary and what they will do if they are clicked so on.
Next for each viewcontroller I create, I will subclass from this ParentTabBarController so that the tabs are already in. You can add additional functionality or override it depending on your situation.
In your appdelegate pass in a navigation controller and every time push and dismiss the viewcontrollers you created in second step.
Hope this helps..

Resources