New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to create navigation barButtonItem #42
Comments
@Sophie1214 Hi, can you please describe what are you trying to achieve visually speaking? |
Okay, so I created an empty
So now the tabController is created with a navigation bar. I want to create a |
Do you mind sharing the entire swift class? |
Sure, but it might be a little tedious. Insert the AZTabBarController into the navigation stack:
Shortened 'createTabController' method:
Dashboard View Controller:
|
So if I understood your code correctly, You are trying to insert the Tab Bar into a controller which is loaded from a storyboard, then setting that controller as the root controller of the existing navigation controller. You then proceed into loading another controller from storyboard and setting it as one of the tabs of the tab bar. Alright I think I understand the issue. Try setting the navigation item of the tab bar instead of the of the child view controller that is set in the tab bar. for example: class DashboardViewController: UIViewController{
...
override func viewDidLoad() {
let tabBar = self.currentTabBar
tabBar?.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Save", style: .plain, target: self, action: #selector(save))
}
...
Let me know if that solves the issue. |
Unfortunately it didn't solve the issue, but you understood the setup perfectly~ |
Alright try one last thing: |
Yes it worked !! Thank you<3 |
I tried to create a
UIBarButtonItem
by usingBut the item failed to be created, and I tried with both the
AZTabBarController
and one of the tab controllers.A little help would be much appreciated~
The text was updated successfully, but these errors were encountered: