Mid-view UITabBarController IOS 7 - iphone

I'm trying to build an iPhone app (ios 7+) that has a view very similar to the one in the attached image. If I had to guess, it looks like a UITabBar in the middle, with a customized UITableView inside each page, and an ImageView up top, all wrapped in a NavigationView? Is it possible to build this app's screen using these components, or is it a whole bunch of fancy custom stuff going on behind the scenes?
Specifically, I care about the tab bar in the middle of the view, controlling what is seen below it. Might that be a UITabBarController?

While UITabBar and UISegmentedControl are fairly similar, they are both best suited for different tasks - In this case, a UISegmentedControl is best.
It can be visually customized quite well, seen here in Apple's documentation.
Because it's a UIControl subclass unlike UITabBar, you can add targets for control events really easily, like this:
[segmentedControl addTarget:self
action:#selector(action:)
forControlEvents:UIControlEventValueChanged];

You could use a UITabBar and conform to the UITabBarDelegate to receive tab bar changes such as a different tab chosen, then change your views appropriately. A UITabBarController is a controller for managing a tab based view controller hierarchy which is not what you want because it would result in multiple view controllers on screen at a time, which is very frowned upon by apple.

Related

Replacing UINavigationControllers NavigationBar with UIView

I am developing app that has multiple skins and I have a dilemma on how to implement this.
One of the solutions would be to have separate nib files for every skin, and load it depending on which skin is currently selected. Problem with this is that I can't edit navigation bar of navigation controller (which my app uses), and I have to change it's background image and back button image etc.. I came up with an idea to hide this navigation bar on every screen and replace it with custom UIView in Interface Builder which will act as navigation bar and custom back button with IBAction for popping current View Controller, so that user won't see any difference.
Is this approach acceptable and if I make it this way, will I have problems with rejection in App Store?
If you choose to hide & replace the UINavigationBar with your own UIView it's no problem as far as Apple goes.
However, I can tell you that you will have to spend some time trying to replicate some visual effects that come naturally with UINavigationBar.
For example, when you push/pop a new controller, you will see that the navigation bar title will slide & fade beautifully. The same applies for left and right bar items.
Personally I would not completely hide the UINavigationBar, but customize it. In the end it all depends on what you want, but by default the UINavigationBar is pretty customizable.
You can add your own buttons or even entire UIViews as left and right bar items. Also, you can add your own UIView as the title (with your own label, custom font or whatever) or change the background.
EDIT:
To easily customize the looks in your entire application, you can subclass UINavigationController and create your own CustomUINavigationController. Then, in viewDidLoad method you can change whatever you want to the navigation bar and this will be accessible in the entire application.
No way, what you are doing is perfect. This will work & no way it will get rejected from app store (just based on this approach). I too have explored several ways to provide skins & what you wrote seemed to be the least hassle-some. Plus its way more easier to create UI elements in Interface Builder hence the separate nib files for different skins.
I am saying this so confidently 'coz I have done the same thing & app store approved.
Best of luck.

Show ToolBar over TabBar

In my app I would like to replace the TabBar with a ToolBar under certain conditions, similar to what happens in the Photos App when a user places it in selections mode (A toolbar with share copy, etc, buttons appear over the tab bar). How can I achieve this please?
This can be achieved by creating a new toolbar, assigning it an appropriate frame and adding it to self.tabBarController.view
I'm assuming your root view controller is a UITabBarController. Sometimes using the canned "Root" UIViewControllers is more of a hindrance than a help, especially if you want a highly custom look that does not fit into the paradigm of what the canned controllers offer. There's no reason you have to use them -- you could write your own, and do your own transition between your sub-UIViewController views onto the screen. You can use the UITabBar without the UITabBarController in your own custom UIViewController subclass, then you don't end up fighting the behavior of UITabBarController. Writing your own root ViewController can be very instructive as well -- you learn about all the things a root ViewController must do to manage the sub-ViewControllers.

Can I re-purpose a UITabBar button as a normal button?

What I'd like to do is have 3 or 4 buttons on a UITabBar. All except one of these behave as normal UTabBar buttons - ie they switch between different views. But I'd like one of the tab bar buttons to perform a function - refresh the app's data - without switching views… Is this at all possible?
I suggest you use a tool bar for something like this and simply change the background of the toolbar to make it look similar of that to a tabbar and then add tabbar buttons to the toolbar button.
Although im pretty sure this will be rejected by apple, as the intended purpose for a tabbar is to change views. It has something to do with the apple guidelines about what users expect from certain UI components. and if you start switching around with the main purpose of a UITabBar it will be a confusing place in the apple application world.
PK

Custom UITabBarController - using a UIToolBar with UISegmentedcontrol as Tab Bar?

My customer wants a design-change, but I just can't figure out how to do this!
The app currently have a UITabBarController shifting between some UINavigationController's. My customer wants to use a UIToolBar with a UISegmentedControl shifting between the controllers instead.
I want to keep the UITabBarController, because that takes care of everything regarding loading and shifting views, but I want the UIToolBar to act as the UITabBar instead of the UITabBar!
I have allready figured out that I will need a custom UITabBarController and possibly a custom UIToolBar as well.
But I have absolutely no idea of where to start, so it would be great if somebody could give me a pointer as to where to start.
Top part to act as bottom part. http://files.droplr.com.s3.amazonaws.com/files/14763142/1g5g1s.Skjermbilde%202010-06-25%20kl.%2012.24.59.png
Thank you.
If I understand your requirements correctly, you want to have a UIToolbar at the bottom of the screen that has a UISegmentedControl that replaces pressing UITabBarItem's to switch between different views and view controllers? Assuming this is true I'd start with a custom UIToolbar class, say SegmentedControlToolbar that mirrors the basic behaviour of UITabBarController and UITabBar to add items to a segmented control, attach view controllers to each segment, and finally handle presses for each segmented control change to actually switch views.

How can I simulate UISegmentedControl with custom buttons?

I'm just beginning to try out development for the iPhone. My requirement is very similar to thar provided by a UISegmentedControl except I need custom buttons instead of those in a UISegmentedControl.
Here's more detail:
I need one view controller which loads the first view having 3 custom buttons on the top. Below the buttons, I need to load different views (Views?) based on which button is tapped.
Is it possible to use IB to design just the lower part of the view talked about here? I want to use as much of IB I can here.
I don't understand why you can't use a UISegmentedControl here? If you drag a UISegmented control onto a Navigation Controller in IB it will be added as a "custom" button control that looks just like a UISegmentedControl. It's found in Apps like YouTube etc. You can then configure it to have three sections and connect up an IBOutlet/IBAction to it easily too.
Edit: Also, if you use a Navigation Controller, you can very easily use IB to design your other views, as that is how Navigation Controllers work - they load their subviews typically from other nibs. Therefore this would accomplish all you want.