For Each Detail View Data to Main View - swift

I don’t have any code for this, so I’ll make up a hypothetical situation:
I want to make a grocery list app. I have a tab bar that sends me to a view where I can create categories in a list (fruits, vegetables, dairy etc.) Each category sends the user to a detail view where they can list off certain brands and the amount they need.
(This is where it gets a bit tricky)
In the main view, the categories that the user made are now tabs that are on the bottom and the list they made in detail view appears on the screen. Any changes they make in the list shown (in the main view) will update back into the specific detail view.
Is that possible? And what technique would be used for something like this?

Related

Swiping Navigation

I have a list view of all my Facebook friend lists. I want clicking on an item from the list view to display a detailed view of the friend. Now I want to slide this detail view of the items to show the detail view of next item in the list. Similarly previous item for left to right.
I have tried using information from this question, but I want to use view pager and page adapter.
you should look at the sample that comes with the sdk which uses a pager adapter and a dummy fragment for data...

Add Data From One Table To Another Table

I have a tableview with genre: rock, rap, dance, country, pop, etc.
Lets say I have another tableView where I can make a custom list with a bunch of these genres.
Say in the mainView, I can add lists, like Dinner, Gym, Studying etc. Then within each of these lists (when you click its cell it will push to a subtableview for that list). I want to choose items from the separate genres to add to this subview. Examplple, Dinner list might include country and classical music, and gym list might have rock and rap etc.
I have everything set up so far except the code that lets me add genres to the custom sub groups. So I can make groups such as Dinner but I need to still make code that lets me fill this group with genres from the other tableView.
I think I need to have a modal view pop up when I click the add button. THis model view will have the genre table and when I click a cell, the modal view will dismiss and it will add whatever I clicked as a cell in the group.
Use the same genre array that backs the genre tables as the data source for the modal table.
In the modal table didSelectRowWIthIndexPath, get the genre string from that array.
Now you have lots of choices for how to get the genre item back to your detail table view controller.
You could post a notification, you could use a KeyValue Observer, you could pass a reference to the detail VC to the modal and then the modal can set an exposed attribute on the detail VC, etc.
Then the detail vc would add that genre value to whatever array is back it's data, and then you call reloadData on the detail VC table.
Your modal VC would have to do something like [navigationController popViewController:animated] to dismiss itself.

iPhone User Interface Guide - Editing top level data

I have a data-driven table view. The root view displays a list of entities (1) that when selected displays another list of entities (2).
If an entity in (1) has a series of properties that I'd like the user to have control over, what's the best UI approach to presenting them with a window for editing this data?
For example, if (1) was a list of Continents and (2) was a list of Countries, tapping a Continent will present a list of Countries and so on. If The user wanted to change a property of a Continent (example change "rateThisContinent") what does convention say he/she should tap?
I was originally thinking of a detail disclosure but that's not really in line with Apple's guidelines for what detail disclosure is.
An edit button might be the way to go, but then what would the table view display after the edit button has been pressed?
Thanks,
Glyn
I've decided to answer my own question. I will create an intermediate 'detail view' after the (1) list that presents all the properties with a button to view the (2) list.
I'll then make the detail view editable.

Designing a tabbed tableview application for iPhone

I'm in the process of learning and designing an app for our company. At its heart, it has a list of "alarms" which when clicked on, goes to a more detailed view with a toolbar to perform tasks upon that "alarm".
I'm having a devil of a time working out how to structure this application. I have something that works currently (i'll explain it in a sec), but now I'm about to hook up the data source for the table and I'm getting myself lost.
At the main screen, there is to be a list of "alarms". This list should be able to be filtered with 3 categories (All, Category 1, Category 2) where the categories are subsets of all the "alarms". I've implemented this using a TabBarController.
Within each tab, I've got a NavigationController (to handle the navigation of between the list and the details) and it's main view is a custom UITableViewController that contains the custom table view.
As described, when you click a item, it navigates to a detailed view. This is all currently working but I'm concerned about the structure.
It's pretty obvious that I have a fair bit of duplication with the 3 different NavigationControllers, but I've read that subclassing the NavigationController is not recommened.
My questions are:
Is there a better way to structure this application? Is there a better filtering method (thats quick and easy) instead of a TabBar?
Where should the tableview datasource go? Most examples I've seen have it being created in the AppDelegate and then passed directly to the tableviewcontroller. My custom tabelviewcontroller is a couple of levels down the controller chain, how do I pass the datasource to it, or can I make the datasource "static"?
I hope that all made sense
Sounds as though you want one navigation controller and table view controller with a segmented control at the top to switch between the different data views. For an example of this kind of layout have a look at how the App Store app works when you select the Featured tab - it has a segmented control to switch between New, What's Hot and Genius.

Strange delay with Navigation Controller behaviour

I have the following set up in a navigation controller.
The root is a list of categories (banks, hotels etc) and each category has a child view below it containing a table view of items (Bank A, Bank B etc). When i select 'Banks' i see my banks (list coming from from web service), but then i go up one level to my root, and select 'Hotels', when the view loads (from web service), i still see my banks, for about 1 second, before the view is updated with the list of hotels.
How can i stop the previous category's list showing up when i choose a different category?
Thanks
Clear the array first before you load the view, try also getting views to reload