UIBarButtonItem question.
UIBarButtonItem question.
- Subject: UIBarButtonItem question.
- From: Alex Zavatone <email@hidden>
- Date: Wed, 02 Jul 2014 11:04:52 -0400
For our iOS apps, to avoid the inevitable spaghettification of our app storyboards and to move into a more modular approach, I've moved our "More Info/Settings" items into their own storyboard.
This "More Info/Settings" module is able to be invoked from a UIBarButtonItem in the top right slot in the Navigation Bar of (almost) every storyboard scene within the app.
At the root of this is a TVC in a Nav controller that lets the user pick the section they wish to get navigate to. Currently, we have items like:
About
Settings
FAQ
Terms & Conditions
Feedback
It's really nice, because it allows us to work more modularly between projects and just plop this section in to all our future projects. But…
Initially, this means that each View controller gets an iBOutlet and IBAction in the header and method files, which is lame and results in duplication of code and manually wiring up the iBAction and IBOutlet for each.
Now, I'm all for proper encapsulation, but I'm not clear on what a proper approach would be to encapsulate this button and conditionally add it to a view controller and how to represent this in code and in the storyboard. Should there be a UIBarButton Item in the invoking storyboard's Nav controller at all?
Should the code for this be added to a subclass of the UINavigationController, or as a class that is imported into each view controller?
I'm sort of lost with regards to how this item can be made a reusable chunk of code and fit within the storyboard. Would this involve an XIB for the Nav controller with the UIBar button item?
Certainly looking for direction along this front. Thanks in advance.
Cheers,
- Alex Zavatone
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden