Submenu in a tableview controller - ios

I'm creating my first app for iOS, and I need something like a submenu for showing data for specific dates, one just like in the last image of the TextHog app http://itunes.apple.com/us/app/texthog/id343405995?mt=8. The menu under the Navigation controller where u can switch between months. How can i achieve this ?

Use UISegmentedControl to make it look like TextHog. You can use it inside and outside tableviewCell. This question may help. How to use UISegmentedControl with UITableView

Related

How to create a tab control in iOS similar to Windows Forms?

I am looking to create a tabcontrol similar to the one present in Windows Forms.
Here is an image of what I am looking to achieve:
What I have in mind to creating this is having buttons at the top and clicking those buttons would hide or show Views depending on which button is clicked.
Is there an easier way to create this component or is this the only way?
You can use either a UITabBarController (Bottom) or you can use a UISegmentedControl. And handle each time you select a UISegmentedControl item, you change a ContainerView (Which will act as the pin/window).
Of course, you will have to play with .isHidden true and false.
Another option is, instead of using a Container View, using a horizontal Collection View with scrolling disabled. And when you select a UISegmentedControlItem, you scroll programmatically to the other item. Each CollectionView item would act as the pin/windows.
If you are not comfortable with any of these options, you can look for a third-party library. For example https://github.com/xmartlabs/XLPagerTabStrip
Look up the UITabBarController. It sounds like a fit for the job.

iOS - What controller is this app using to display the date and controls to move forward and backwards by one date?

http://imgur.com/xiyWIMs
At the top is a UINavigationController with the title fitbit and a button on the right for editing.
Below is a controller that displays the current date and has buttons to the left and right to move forwards or backwards one date.
Would this be another UINavigationController or something different?
No this would be a custom view with a UILabel displaying the date and two UIButton changing the date.
I don't personally use Fitbit so I'm not speaking from physical experience, but based off the picture it looks like they are doing the following :
They are using a UINavigationController for sure. This automatically creates the Navigation Bar at the top, where you can add the 'edit' button. This also creates a 'back' button when you click on a UITableViewCell to navigate back to the main tableView. The cells look like their row height is set to about 100 or so. The date header is simply a custom tableView header which you can set by doing the following :
[self.tableView setTableHeaderView:datePickerView];
or for a specific section :
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
}
And then the tabs? How can you add tabs to a UINavigationController? Easy. All you have to do is click on all different 4 tabs respective UINavigationController (dashboard, challenges, friends, account) and go to your Xcode menu bar and select :
Editor > Embed In > and then select Tab Bar Controller
So to answer your question, it looks like to me it's a combination of both UINavigationController & UITabBarController.
NOTE this can be done numerous ways, i'm just offering a way of how it could be done to emulate it, you won't know the exact way they do it.
Instead of creating my own tutorial for you, here are some good ones to skim through to get you started:
Embedding : http://www.appcoda.com/storyboard-tutorial-create-tab-bar-controller-and-web-view/
Setting a custom tableview header : http://www.accella.net/custom-header-and-footer-views-for-uitableviews/
That one goes through a couple options but it's easier just to use self.tableView setTableHeaderView: can be implemented anywhere and uses minimal code.

UITableViewController with SearchBar

I have tried both ways below to place SearchBar on UITableView.
TabBarController > UITableViewController(Put SearchBar)
TabBarController > UIViewController > UITableViewController(Put SearchBar)
When I try the second way, then it doesn't work.
(SearchBar cannot show on UITableViewController)
Can anyone tell me what happend?
Here is my xcode project file:
http://www2.zshares.net/tg14vowqzvaw
the usual way to do this would be to put the saerch bar in the header-section of the uitableview its supposed to search. you can do this using the
-tableview: viewForHeaderInSection:
method from the UITableViewDelegate-Protocol. his works in both TableViewControllers and regular ViewControllers that just have a TableView on them. see the mail app on the iphone for an example of this.
if you really NEED the search bar to be outside of the tableview, then you will have to use a regular view controller and just place the search bar in a view above/under the tableView.
other than that, i dont know what to tell you. And what is a TabbedViewController? Do you mean TabBarController? What does that have to do with search bars? Im kinda lacking the time to go through your project, so if you rephrase the question, maybe i can give a better answer?
EDIT-----------------------------------------------------
tableviewcontrollers will do that to you. basically, they will allow ONE tableview to be inside them at a time. also, this tableview WILL ALWAYS fill out the entire space available. Now, there is an exception to this that you cam make use of: Elements like a NavigationBar or a TabBar are allowed alongside the tableview, since they are required for navigation. So if you can put your stuff in one of these, its entirely fine. This my seem counterintuitive, since when do i want just a naked tableview on my screen? the answer is: more often than not. Tableviews are HIGHLY customizable using the UITAbleVIewDelegate-Protocol specified here:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UITableViewDelegate
Do yourself a favor and read that doc, i almost guarantee that you will save time in the long run.
For Example: You know the contacts app on your iphone? If you go into the details of one specific contact, you will find a pertty sophisiticated presentation of the data, that will even go into editing mode if you tap edit. It has a header, multiple segments, and a footer.
Surprise: ALL OF THAT is just a single tableview in a tableviewcontroller, customized via the protocol. Let me repeat: you are wasting your own time if you try to do it any other way. tableviewcontrollers exist for a reason. usem them

iOS - Use Tabs as a Filter

Is it possible to use tabs to act as a filter for a list view?
I know you can add new tabs by hooking them up to new view controllers, but I would ideally like to use the same view controller, but show different items based on which tab is selected.
Can anyone point me into the right direction?
I think you may want to use a UISegmentedControl instead. It looks kinda like a tabbar and of course you can use it to filter list results.
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISegmentedControl_Class/Reference/UISegmentedControl.html
I would not suggest using tab for that purpose.If the filtered results are to be shown in the same view controller you can use Segmented Control with various segments.
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/SegmentedControl/Articles/SegmentedControlCode.html

implementing uitabbar to uitableview

I want to put a uitabbar into a section in uitableview, I have hard time looking a way for it, since I just started doing XCODE in less than a month. Anyone there know the solution for it? Any help is appreciated, and if possible, could you share a link for the tutorial or examples as well. Thanx in advance.
You can't do it in this way. They both are different things but you can have UITableView inside the uitabbar view. But vica-versa is not allowed ...this is not feasible and also not proper as per apple's guideline. So, please make sure not to use in this way...rather go for some other alternative :
like put Custom UIToolBar in header of tableView , having look & feels like Tabbar.
You cannot put a tab bar into a tableview.
I you want to use a tab bar, use it as a sub view of a UIView.
The UITabBar is supposed to contain other views. So no, you cannot add it to your table view. To get the look and feel of the Groupon app, there are two things you could do:
1. Create a custom tableviecell as advised above.
2. Since the toolbar (which looks like a tabbar) is outside the actual table, you can have it as a separate view and reduce the size of the table to accommodate it. Or add the toolbar to the footer view of the table.

Resources