Table View Add Functionality? - objective-c

I am new to the field of iOS development.
I have a tab bar application with four tabs, my second tab is a navigation controller which has a table on it when I press a cell it pushes to my detail view. My third tab is a favorite tab, and what I want is if I like anything in my table view how can I make that value go in the Favorite tab which might also have a table in it.
I want you ideas how can I do this ?
(Like should I have a button on the navigation bar "Add to Favourite" as soon as I click on that tab my table changes into edit mode with the "+" sign coming in front of every cell, the value I like I press the + sign and it goes in the favorite tab) this is what I thought but I really don't know how to implement it.
Can you help me out in this ?

This question's way too big for Stack Overflow. You should really go through Apple's sample code and documentation.
To get you started:
For the 4 tabs, you most likely want to embed everything in a UITabBarController, which will be your root view controller.
To get the edit mode functionality you're looking for, you're going to want to override - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath to enable that. (See UITableViewDelegate documentation).
Using the edit mode "+" button functionality as a way to add cells to a favorites list is non intuitive. Your users are going to be used to seeing that button in the Contacts app, etc, in the context of being used to add more fields or more information. They're not going to expect it to put things in a list in a different tab. See how Apple manages favorites in the contacts app for an example of how to do it right. You should also consult the Human Interface Guidelines.

Related

How to develop iOS app just like AppStore's searching function?

I want to develop a simple dictionary application which is like the Search tab of AppStore on iPhone:
The 1st screen have a SeachBar on top, the bottom is "History words" (such as "Trending Searches" on AppStore).
When user touches the SearchBar, the bottom view is gray. Touching the gray area to leave the Seach text-box and my user is able to click on one of history words.
If he/she types on SearchBar, the suggestion words list appears and he/she can click a word to see its definition with the SearchBar containing the word there (I don't want my users having to go to 2nd view to see word's definition because if so, they must click Back button to touch and type on Seach text-box. It's likely that, my application has only 1 ViewController).
I know how to work with SearchBar and TableView to display the suggestion words list but don't know what to do to implement other things:
Make a view gray; touching on the gray area to leave the Search text-box
Hide the suggestion words list (TableView) -> user can see "History words" again
Keep the SearchBar -> user can type immediately to search other word when he/she is seeing current word definition
Thanks for reading and please show me some keywords, clues to solve three issues above.
Many thanks!
Use UISearchController to create a page like you wanted.
It has dimsBackgroundDuringPresentation property to make a backgroundView gray when user is typing.
It has - (instancetype)initWithSearchResultsController:(UIViewController *)searchResultsController method. You can initialize the UISearchController with resultsController. For results you can do whatever you want.
Lastly, you can set a custom view to see "History words" to UISearchController

How to make a tab bar that shows colored icons , on iOS?

I need to make a toolbar on the bottom of the screen with some buttons. I want in every button to have a small image and a small text under it. The closest i can find from "Xcode" is the "Tab Bar" where you can put icons and text but the problem is that when you add an image you can only see the shadow of the image and not its colors.. Can i change that? Or is another way to make a toolbar like the one i am describing?
EDIT
I need the buttons to change controllers and i just noticed that i cant create actions for the tabs but only outlets. So i guess the tab bar is not what i should use. Any ideas for a toolbar?
Yes Tab Bar is the Best approach for it and it is very easy to customize the tab bar if u are using IO5
This LINK will be helpful.
There is another approach (which was applicable uptil IOS4 for customization of Tab bar) was to Create Custom buttons with tab bar look alike Images. it will give u the same feel, but like i said it is very easy now to customize IOS Tab bars
Here is a couple of Links for u
LINK 1 With Story BOARD
LINK 2 Without Storyboard
One More thing Try searching Google before Posting a question here if have some problem then feel free to post along with the code or tutorial u tried.
Let me know if i Worked
Cheers
W

How can I create a back button on a Tab Bar Controller view?

I wonder if someone could help me please? I'm brand new to iOS and whilst I've been searching various sites for my answer, I'm afraid I haven't come across it yet but feel this could just be my naivety to the language so I apologise if this is a really simple thing...
I have a Tab Bar Controller with 3 views. On my first tab I have a button which when clicked, I want it to go to the 3rd tab (which is does). However, on the 3rd tab, I would like to insert a back button so that the user has the option of clicking back to go back to what is essentially the main menu of my application.
Can anyone tell me how I can do this please? I'm currently using storyboarding as I'm not very good with the language yet but any help would be greatly appreciated.
Thanks
Sean
You need to add a navigation bar to the view and set a bar button item with the action to change the tab.
Remember that a tab controller is standard across multiple apps, the user is use to tapping the tab to change the view rather than pressing buttons within the view.
It might be worth you looking into a UINavigationController
The first thing, you are implementing UITabBarController. you don't have to create a back button, because user can navigate between screens by tap on tab bar.
Second thing, you can use UINavigationController to manage you viewControllers,the Back button will automatically show when you push ViewController by method pushViewController:animated:

Objective-C - What's techniques/objects are being used

On my iPhone, when I go into the Settings app, I see "Airplane Mode", "Wi-Fi", "Notifications", etc. and I'm able to scroll through pages and pages of settings.
I'm new to objective-c and I'm trying to duplicate the functionality in my own app, but I don't know enough about the objects and techniques to know what to ask or what to look for. :)
With that in mind, can someone please explain what's going on with the settings app? What is this using? Is it a UITableView that allows me to scroll down the page? What control is being used to store the text "Airplane" mode? What is happening when I click on the ">" and see a new page?
Any tips are appreciated.
While nobody outside Apple can be 100% sure how they implement their apps, some reasonable guesses would be:
The main screen is a grouped UITableView. Each entry is a single cell.
The text and images in the cells are built using properties of UITableViewCell (e.g. the textLabel UILabel for the text "General"). Some of the more advanced items use custom cell views.
Each category view is another UIViewController, pushed onto the viewControllers stack of a UINavigationController.
The on/off switches are UISliders.
It is a TableView
Table View programming Guide
samplecode
These docs cover all you need

Animating Tab Bar page switching

I'm quite confused with the whole animation stuff in iPhone SDK. I tried to study throught the SDK documentation, this website or tried googling it out without success.
I'm unable to get my scenario work.
I have single XIB file, with tab bar and a 4 tabs.
In a special event i want to switch from one page to another "in code", so I call eg: [tabController selectedIndex: 0].
I need this transition to be animated. Is there a way?
If user switches tabs manually, no animated transitions are needed
Also I have one subquestion:
In one of the tabs I have a UITableView with set of items. When user clicks any of these items, another set of items are beign shown (sort of hierarchy browser)
I tried to animate this transition using -deleteRowsAtIndexPaths:withRowAnimation: and -insertRowsAtIndexPaths:withRowAnimation:, but without luck.
Desired transition is shifting the old items set to the left side and the new items from the right side.
This is first time of my iPhone development, when I got lost even with all the forums and documentation. :)
Thanks in advance to anyone trying to help me!
As for your first question: Yes you can.
Try this link for some answer:
transition on tab bar sample code.
In short words: you should add a delegate object to handle the tab bar switching by setting the tabBarController.delegate = self.
Yet, what this forum post won't tell you is that you need to "import" some framework to do it.
First - right-click on the framework folder on the left hand list in Xcode and add an existing framework named: "QuartzCore.framework".
Than - add these lines to your tab bar holder (on .h file):
#import <QuartzCore/CAAnimation.h>
#import <QuartzCore/CAMediaTimingFunction.h>
As for your second question, try to replace the datasource (array or what ever) or create login function on the cell to replace its content.
Enjoy!
First Question: No, you can't animate tab switching. Please read Apple's Human Interface Guidelines on this. Tabs are meant to switch instantly. An animated transition would break the "tab" paradigm.
Second Question: When you tap on a row, the user does not expect other rows to disappear and new ones to appear. Instead, this sounds like a case for a UINavigationController. Please refer to Apple's sample code, specifically the UICatalog for sample code on how to implement this.