SWIFT: First Time Input / Edit Mode, one screen or two screens? - ios

I've create the following screen which takes 4 inputs when the user creates an account and 'Submits' for the first time.
After they submit once, the screen should go to "edit mode'. My question is, is it more effective to create two view controllers (one for initial input, and the other for edit mode), or just one view controller. If the latter, does anyone have any examples or tutorials? I'm positive that I'm not the first one to attempt this. Thanks!

All you want to do here is toggle the button's title and the editability of the text fields, so it is simplest (and best) to do that in place, in the same view and the same view controller. You are merely changing features of this view, not swapping out this view for another world of interface.

Related

How many view controllers would I use in this app setup?

I am very new to iOS programming and iOS code design, and I am working on developing a simple iPhone application. The basic layout of my application is as follows:
In the first page, the user is presented with a list of categories. Upon clicking on a category, several options with drop down. Upon clicking on an option, the application will transition to a page where the user will input a number of values and be presented with an output. How many view controllers would I need for this application? Based on the little experience I have, I was thinking of using a view controller for the main page and then one for each option, but is this necessary? Is there a way I could use less view controllers?
Depending on how complicated and different each option is, you may be able to use one view controller for all options.
So..
Main view controller- Shows a list of categories, where options could show underneath when tapped
Option view controller- Shows input boxes with labels and an output box. You may show/hide different inputs based on how many you need and you can change the label text accordingly.
This would give your app the smallest UI with the most flexibility, in case you added more options.
Of course design is very subjective and depends on the deeper details of the project, but based on your description, I would implement it with 2 view controllers.
If the screen where you input the values can be generalised, then you will have only 2 view controllers.
But in the implementation of the first one, you will have to implement function:
func prepare(for: UIStoryboardSegue, sender: Any?)
to pass the data about the selected item. And the the second view controller should adjust its fields accordingly.

Same View in different view controllers?

I have a view like this:
Each one of the buttons has an action to do when I click on them. And these buttons are changing dynamically through coding (if statements...), when I click some button it leads me to other different buttons values..also the Label is changing accordingly.
ITS LIKE A QUIZ KIND OF THING!
What I want is when I click a button , It should lead me to a different layout of the (view buttons) ( area ).
I was thinking of adding a new view controller for each of what I want to do but this could mean 100 view controllers! I don't know if this is the right way to do it. Is there a better way?
First I'd find similarities between your desired layouts. Implement one view controller making all of those similarities happen. For instance:
show a label on top
show four buttons below
step back and forth between layouts
show different kinds of buttons according to their description
Then you can initialize your view controller with a description of your questions, potential answers/buttons and behavior for each button. Let's say it's a quiz. So you create a class Quiz containing an array of Questions. Each Question contains the question it self as a String and a description for each of the four buttons. It could be the shape and color or a text/answer. And of course some sort of actions for the buttons. It could be just as mutch as a boolean state or a more complicated enum. You get the picture?
(My answer seems to be as vague as your question.)
In the end you'll have to write the whole description for your requirements. I'd write this into a txt, csv, plist, json (whatever is convenient writing and parsing for you) and parse it. That would be the fewest code.

how can i desgin this each layer in single view

This values get from web servies. Totally i want to show 4 layer to display[i show here only 2 layer]. some times in web servies values are come more means the layer become big and show the values.same and anther 3 layers are displayed. help me..!
Use UIScrollView or Freeform make it independent means don't use static value make it dynamic whatever number of layers you are getting from server and according to that adjust content size of UIScrollView.
First of all. This view (and design) doesn't really follow any iOS consistency. The Apple human interface guidelines are there to help you with finding the correct way to do something.
Right...
Do you need to show all the options at the same time? i.e. do you need all four "layers" on the screen at the same time? If so, why? What is the user supposed to do with this screen?
Is the user selecting one option from each layer? Multiple options from each layer? etc...
With either of these I would go down the route of using a navigation controller with a single UITableViewController to display each layer.
So, the user gets a nice list of options...
dumbell
E-Zbar
cable
barbel
...
And selects one (or many) of them.
Then the second "layer" is pushed onto the navigation stack and the user gets another nice list...
incline
decline
close-grip
rotating
...
This way the user has to only concentrate on one task and each list is deployed nicely and readably for them.
If I was a user and was presented with a big list of buttons like your design I wouldn't know what I was supposed to do.

Putting a UIPopvercontroller in a storyboard uicontainer view

I am writing a small iPad app using Storyboards. On the first screen the user will be presented with about 7 pieces of information to enter.
Several pieces of information are of the form "How important is X to you" with 5 or 6 possible answers, like "Extremely Important" and "Very Important" and so on.
I think the correct design pattern is to have a Button on the storyboard with the value on the button, and the user can change the value by tapping the button, and then I will present a list of values in a UIPopover in a ContainerView.
First, is this the best design pattern.
Second, can someone point me in the right direction for accomplishing this? I just can't seem to get the pieces to work.
I am thinking that maybe I do not need the Container View, just the UIPopover.
Any help would be greatly appreciated!
Bryan
I suggest using a UITableViewController in a popover. The table contains all the valid options in the appropriate order. When the user taps (selects) a row in the table, invoke a delegate method that passes the selected option, sets the button text, and dismisses the popover.

Modal to Double View and NSUserdefaults/CoreData. Where should I begin?

Ok, so this is going to be long, and may be confusing. I am using Xcode 4 w/ iOS SDK 4.3
I will describe my scenario, and what I need. I am fairly new to Objective-C, but I do understand basic concepts etc. I am not asking for someone to do this for me, I am simply asking for some help with how I should go about starting, doing certain things, and making it work smoothly.
I will try and explain what I need in most detail, to prevent confusion. I am truly sorry if this is lengthly, and I appreciate any help what-so-ever. I have been struggling with this for a good week now.
I have a tab-based iPhone application, and the first tab is a Welcome page. I need a first-time use page, which will appear if only it is not filled out.
I will now simply list what I am trying to do.
If the user has not filled out the setup page yet, modally display it after application launch. For simplicity, I will refer to the first"setup" page as "ModalSetup1"
On ModalSetup1, there are 2 segmented controllers, and one switch.
The first has 5 options, and the different options are: 8,9,10,11,12.
The second segmented control has 2 options, they will have text labels, but I am not sure how I am going to implement this (string or int?).
The switch is an optional selection to do another part in the setup. If selected, the "done" button at the top right of the screen will change to a "Next" button, and when you hit Next, it will take you to another part of the setup (ModalSetup2), instead of closing, which it would do if the switch was set to off.
Now, there is another part which might even get more complicated, but I will explain that later (ModalSetup2). I don't even know if you can display 2 different views modally…
What I need is the segmented controller options to be saved, and be able to be retrieved from other tabs/views. The settings won't actually display on the other Views, but it will actually tell the other views to act. Use an "If Statement"?
Now, this part is the next section in the setup. It is "ModalSetup2".
There are 8 buttons, and when each button is hit, I need a picker to be displayed similarly to how a keyboard is displayed. All 8 of these pickers will display the same content, but each is individual as they are each different, and I need a selection from each one. In the pickers, it needs to display 3 columns. Once the user has completed filling out the pickers, they will hit done, and all of the data will be saved, and should be able to be pulled and used in other views of my App.
I am having trouble with pulling the data that is selected (currently saved via NSUserDefaults) and displaying it on another view. Another problem I am having is switching to another view Modally, while still being able to switch back to my original view.
If you need any more info, just let me know. I am adding pictures in right now, so please be patient.

Resources