Tech Design to achieve a workflow usability using UINavigationController - iphone

New to iOS development with a simple technical design question. The project I'm working has walks a user through a set of questions, upwards of 20. I want to use the UINavigationController to give a workflow feel in terms of usability with the back button and Next button in the navigation bar - that is a requirement. However, the design of each of the 20 views will be identical, except of course for the content which will be data driven.
From a design standpoint, would I...
Replicate the View Controller 20 times with 20 separate h and m classes, and use push segue's between each to give a workflow feel.
Replicate the View Controller 20 times but connect to same h and m class.
Redraw the View each time the user clicks Back or Next, thus keeping 1 viewcontroller
I've looked at several samples with xib files, but I'm looking to pull this off with the latest version of xcode and storyboards.

The simplest approach will be to reuse what has already been created. The View (From Modal-View-Controller) part of your application needs to be implemented only once.
All you need is a simple action to allow user to navigate between provide options (20 in this case).
The preferred option in this case will be
3)Redraw the View each time the user clicks Back or Next, thus keeping 1 viewcontroller
All you need is to update the content (equivalent to redraw the view)using proper selectors such as
- (IBAction)navigateToNextOption:(int)index;
- (IBAction)navigateToPreviousOption:(int)index;
You might also like to handle validation based on indices and prompt user to select proper navigation buttons.
A simple case say what if the options are 1000 , might also help you decide the best approach.
Cheers!!

I would suggest that use a single viewcontroller and show the animation behavior like UINavigationController on next and back button click. use this source code a Git
kASlidshow git repositry
how it looks
replace the arrow buttons and place it a top of the UIViewController.

Related

Should I use UISegmentedControl or UITableView for navigation?

Fellow stackers,
I am developing the interface for my iPhone application and I'm in doubt about an important paradigm that is present in almost every view I am making. I've read the Apple Human Interface Guidelines but I think that my question isn't answered there.
The problem is, e.g. in the "My Account" view I have to display all the kinds of content the user has created (Comments, Favorites, Notes, etc.). I am currently planning of displaying those as UITableViewCells in the main UITableView of "My Account": there will be a cell for Comments, that pushes the comment controller in the navigation controller, and so on for the other kinds.
One problem arises anyway: I've noticed that many applications use UISegmentedControls to accomplish the same task, and they seem to do so in a non coherent manner. Sometimes they use one method or sometime another. Is there a clear way of choosing one over the other? Or is it just personal preference?
I believe that there are situations where one is likely to be better than the other. As a personal rule of thumb, I avoid cluttering the current view with buttons that link to all the other available sections. I instead prefer an index where I can pick a section and have it load up that, then when I'm done, go back if need be.
So for example if you were using a tabcontroller to navigate between views like the "My Account" view, I would not use a UISegmentedControl. I would use a UITableView. This just allows for you to be more focused on the task at hand.
However, if you belive that your users will be flipping between sections in the account view more frequently, then maybe a semgented control would be the way to go for you.

iPhone Table View Data Edit Pane

I have an application I'm working on, and I need the user to be able to add new "Shows", "Movements" and "Dots." These are all represented by classes. At the root of the application, all the shows are shown, the user can click on the show, see the movement in that show, then tap on a movement and see the dots in the movement. It works beautifully.
Now, I need the user to be able to add and edit these instances of these classes. The way I am thinking this will work is when the user clicks on the "Add Show" button (Or the "Add Movement", etc) a new view will be pushed onto the Navigation Controller. This works. When the button is pressed, a new instance of the show class is created, and passed to the new view controller. This also works. If the user wants to edit the show, then they will hit the edit button for the row, and the instance of the class (which already exists) will be passed to new view controller, and the user will be able to edit it (It should use the same view controller for adding and editing)
My question is, in the examples I have seen, it is always really dirty to create the editing view. The edit view is a table view with each row having some sort of control. Usually it is a UITextField, but it may be a slider, and it may be one where another view is popped, and the user needs to check one value. (This is similar to the address book application when adding and editing a contact)
Is there any way that is cleaner than just manually going in and creating a bunch of arrays to hold what custom table view cells need to be at what row? This gets very messy, very fast. I can do it this way, I just was wondering if there is a better, possibly faster way.
To my knowledge there's no structural solution to solve this. I'm afraid managing the cells with child UITextField or other controls yourself is the only method. This indeed gets dirty and painful very fast, I certainly feel your pain.
Although it doesn't exist, it would be very convenient if Apple added out of the box editing cells to the SDK, similar to the different normal cell styles. I haven't come across an open source project that addresses this issue, but it might exist.
If you do find a better/cleaner method to handle these situations, be sure to ping back.
as far as i know, editing mode is the only way to make the changes you describe (if i understood correctly). I agree that it doesn't seem like the most elegant approach.
http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/ManageInsertDeleteRow/ManageInsertDeleteRow.html#//apple_ref/doc/uid/TP40007451-CH10-SW19

How do you create a sequence of modalViewControllers?

I have struggled and now I just need to see it in action. I have an info-button on my title page (UIViewController) and I want to bring up an About-view with a 'dismiss' button on the left and a 'detail disclosure on the right.' If one presses the 'detail disclosure', it brings up the PrivacyStatement-view with the same buttons. If one presses the 'detail disclosure', it will bring up a Credits-view. I should be able to continue this for additional Legal, etc.
According to the Apple doc's one dismiss will dismiss the entire sequence, regardless of where one is at the time.
I have been able to get the views to show, but they won't dismiss themselves. These leads me to think that I am not using the preferred approach but rather, I have developed an ad-hoc approach that leaves me with dangling structures.
Any suggestions? I have my thoughts, but I am only one two levels deep and the dismiss doesn't work! :( I have a total dead-end and have to Quit the app to get back on the real App view.
I got it! Basically, the code is cascaded along the 'workflow' of viewcontrollers. I devised a style where most of the technical class management is done by the tools and leaves me with book keeping and content. I will need some review for memory management, as I think my current code is probably leaking controllers up and down the path. Also, the fact that I can traverse back and forth leads me to think that I really just have a stack of views and not modal views. I will post the code sometime by the end of the week.

Wizard style of interface in iPhone

How would one implement a wizard style interface for the iPhone?
For instance I have a form that I would like to break down into 5
different pages or views instead of putting all the information to fill out
into one page or view.
This interface must have the ability to go prev or next in case they want
to change something on page 2 when they are on page 4.
This interface must have the ability to go to page 3 directly and still be
able to go prev and next. Seems like using UINavigationController wouldn't
work here since views 1 and 2 are not on the stack so prev would not work.
Update: Check out the "gas cubby" application. It has what I'm looking for. UITableView presents the items you can fill out. Selecting a row takes you to the detail view to enter data and prev and next to fill in other information.
UINavigationController seems like the obvious solution. It gives you nice, familiar page transitions for free, and if you need to jump to a specific page you can just set up your navigation stack without using the transition animations.
I would say use a Navigation Controller. On the 1st view, show the 5 options in a Table View. The user selects a row, and then the corresponding section is pushed onto the stack as a new UIViewController. So, if they are in view #3 and want to go back to view #1 (to be honest, I would recommend rethinking whether or not somebody in the real world will actually want to do this), they hit "back" and then select view #1 from the table.
I can't think of a better way to do this because you won't have room to do something like breadcrumbing, which Apple would recommend against anyway. You could use a tab bar but that is more like options then some sort of wizard workflow.
If you really want them to be able to skip around the process, the combination of a UINavigation controller with a UISegmentedControl to jump to sections would do what you want. You can either embed the segmented control in the nav bar or place it just below the nav bar (which seems more like what you want since you have five sections).
If the Segmented control is not quite to your taste just put up any set of five buttons to change sections and make them visually appealing.
A "wizard" UI is typically used when you have a relatively small number of steps where one step depends on the previous, at least at some steps, the results or presentation depends on previous steps. This is like a navigation tree that usually results in the use of the navigation controller, but with only one potential branch at each each step. My feeling is that the navigation UI would be perfect, but with one exception; A button on the right hand side of the navigation bar that is the left to right mirror image of the "back" button that is usually found in the left part of the navigation button. That button would navigate to the the next step, and at each step the page presented would allow the user to fill in the information for that step. The only problem then is navigating to a step not the next or previous, and this could be corrected with a custom button that includes a drop-down list of the steps in the process. And this would fit nicely with the rest of the iPhone UI, which Gas Cubby's wizard UI (as good as it is) does not.

UIToolBar - How to Handle Button-Overflow?

I have a view with a toolbar - each button on the toolbar represents a new message the user is composing. It took me several work days to figure out how to handle the view switching, etc.. but now that I have that all figured out, I have run into a bit of a UI-snafu.
When I have over 11 buttons (I know, a user should really SEND the first 10 before creating an 11th, but I am trying to be thorough) the buttons run off the end of the screen. There is no indicator (aside from the half-button you can see), that there are additional button(s) that can be pressed.
Has anyone run into a situation like this before, and how have you handled it?
My initial thought is when there are more than (lets say) 8 buttons, I programmatically make the first and last buttons "<" and ">" buttons that will slide the buttons down, by removing and adding buttons to my [toolbar items].
Any thoughts?
Instead of creating a new type of UI for the iPhone (which Apple may or may not accept) it would probably be best if you just told the user that he/she has reached the limit and will have to send a message before they can create a new one. Like Safari does when you try to open a 10th webpage.
I think Kane is probably correct, but what you're trying to do sounds a lot like a scrollable tab bar. Three20 offers a class that handles this, or you could implement it yourself. There's no provision for this in the OS (I think the UI guys would probably strongly object if you said you were trying to put 10 buttons down there, let alone MORE than 10.)