iOS "Done" button to dismiss modal or to complete Edit? - ios

In iOS, I have some modal scenes that dismiss with a "Done" button in a toolbar.
But one of those modal scenes includes an editable UITableView. So I also have a standard Edit button (in a NavBar). While Editing, that button is renamed "Done" (and highlighted in blue).
Now there are two buttons labeled "Done" that do two very different things. I could rename the dismisser to "Cancel", but that seems like a non-standard usage. And it would be at odds with the other scenes (that don't involve editing), which dismiss via a "Done" button.
Is there a Human Interface recommendation? What's the "cleanest" solution?

The easiest solution is that your "Done" (dismiss) button is not displayed while editing, so that it looks like this:
Not editing: ....[Edit][Done] <- (Done-dismiss)
Editing: ..............[Done] <- (Done-editing)
Another thing you can do is set the "Done" (editing) button on the left side (as well as hiding the "Done" (dismiss) button), so that the user notices it's a different type of "Done"
Note: From a UX point of view, showing two "Done" buttons that look identical on the same view at the same time is very wrong, even if they are in different positions

Related

What is the correct approach for dismissing the keyboard when using a UITextView?

I am wondering what the best approach for dismissing a keyboard is when using a UITextView. At the minute for UITextFields I dismiss the keyboard when the return button is pressed. However for the TextView I want to have the return button actually add new lines so there is no additional buttons remaining to close.
What if any is the current "standard" approach for dealing with this issue? For example is it to add an additional button on the screen or is there another approach?
Thanks
On the iPad there is a "dismiss" button on the keyboard. For iPhones, add an inputAccessoryView to the UITextView. Put a "dismiss" button there.
If you have several fields (text fields, text views, etc.) in some sort of form, you could have a standard inputAccessoryView for all of them. Include a "Next" button (to go to the next field) and a "Done" button (to dismiss the keyboard).

iOS navigation views with both "back" and "save" buttons?

I am new to iOS programming and need some help on creating navigation. I have a top-level view, shown on the left. When the user presses the "Create New" button, the app should bring up the "One Journal Entry" view, shown on the right.
I currently have implemented the two views with navigation using a Navigation Controller. The problem I'm finding is that there are now two ways to navigate back: (1) Using the back button in the upper-left and (2) using the "Save" button, which saves to file. I think the back button should go back without saving, or perhaps that should be a "Cancel" button instead, in which case I should not use a Navigation Controller.
What is the standard UI approach for this type of problem?
I think you shouldn't change your views' architecture, it is pretty standard and handy with going back to previous view controller by upper-left button and going back also by save button, which IBAction can look like
-(IBAction)doSaveStuff:(UIButton *)sender
{
// saving stuff
[self.navigationController popViewControllerAnimated:YES];
}

Should I use a tab bar or button at the bottom of my ViewController?

I'm just learning iOS, and I want to create an App which will have a few buttons at the bottom of the screen.
What I'm a bit unsure about is, I know you can use a tab bar down there, but is that what you should always use when you want a button at the bottom of the screen? or there's no need to use a tab bar, and you can just put a normal button down there?
According to apple's documentation, UITabBar is a control used for displaying views.
A tab bar is a control, usually appearing across the bottom of the screen in the context of a tab bar controller, for giving the user one-tap, modal access to a set of views in an app.
If your goal with this "button" is to display other views, then you should use UITabBar component.
But if you are just searching for a "usual button", then you should use UIButton component.
A tab bar is expected to allow the user to switch between, you know, tabs; the same bar appears at the bottom of each page, and it allows you to switch between them. If that describes what you are trying to accomplish, then it would be appropriate. If your button is meant for some different purpose, then a tab bar might be misleading.
A tab bar (class UITabBar) is usually part of a tab bar controller (class UITabBarController). A button (UIButton is simply a way to respond to a tap or other actions within the button.
You want to use a tab bar and tab bar controller when you need to switch between different views and view controllers in your application. For example the Music app on your iPhone has a tab bar controller that switches between Artist, Playlist, Album, etc. These are different screens, or screens that look the same but show your music organized in a different way.
If all you want is to respond to a button, for example to print out to the console or show a message to the user that says "Hey, you've tapped the button", then a UIButton is what you need.
Also, a UIButton can have many actions, Touch Up Inside is probably the one you are looking for. This one will ensure the button has an action called if the user began a tap on the button, and let go of their finger while still on top of the button.
To summarize things:
Use a UIButton if you simply want to respond to an action, and the most common action you will connect to the button is Touch Up Inside.
Use a UITabBarController to have a way to switch between different views and view controllers.

iOS Storyboard flip horizontal animation disables text fields

I have a very simple story board . There is no code involved in this yet. The problem I am having is that when I change the transition to "Flip Horizontal" the text fields get disabled for some reason (i.e. clicking on the text field does not bring up the keyboard). This is triggered when with the following sequence: click on text field keyboard pops up -> hit next -> click on text field keyboard pops up -> hit back click on text field -> keyboard no longer pops up
After that going between the screens and clicking on text fields does not work (i.e. the keyboard doesn't pop up). It works fine if I use default transition.
Any ideas on why this is happening?
I'm not sure this is your problem, but your storyboard setup is wrong. It looks like you're going back and forth with modal segues. Every time you do that you're creating a new instance of the view controller you're going to, so you're piling up more and more controllers, none of which ever gets deallocated. Unless you're using an unwind segue, you should never go backwards in a storyboard with segues. So, when going from the controller you show on the right back to ViewController, you should just use [self dismissViewControllerAnimated:completion:] in code, and get rid of the segue.

Tabbar not showing in ios application

i am making one iOS tabbar application in that i have put 4 different tabs and whenever i click on 1 st tab and load another view after clicking of the first tab. After that when i press back button then tabbar is not displaying .So that i want hint that how can i show that
back the tabbar when we move from one tab from another and yes how i can use consistent the tabbar in whole application can you just guys help me on this i am new to iOS development.
here i am put the screen shot ...
here first screen is this one..
when i tap the video button that are first in the view then another window open
which are as under and see the tabbar is not there...
when in video controller there is tabbar is there but i drag and connect to that then tabbar is disabled
Looking at your screen snapshots, do I correctly assume you're attempting to transition to the "Videos" scene by touching the big "Videos" button in the center of the "Home" scene (rather than touching the tab bar button at the bottom of the screen, which I assume works fine)? If that's the case, you need to have your button tell the view controller's tab bar controller that you want to change the index of the tab bar, and it takes care of it for you. You cannot do the transition using a segue (or at least not without a custom segue, which is even more complicated than the procedure I outline below). If you're changing the view some other way (e.g. using a standard segue or using presentViewController, pushViewController programmatically, etc.), your tab bar can disappear on you.
You later said:
when in video controller there is tabbar is there but i drag and connect to that then tabbar is disabled
Yes, that's true. You cannot use a segue from one of your big buttons to one of the tabs in your tab bar. (Or technically, if you wanted to use a segue, it would be a custom segue which would do something very much like my below code, though perhaps a tad more complicated.) So, rather than using a segue for your big button, you need to write an IBAction (connected to the big Videos button on the Home scene), that tells the tab bar to change its selection:
- (IBAction)clickedVideosButton:(id)sender
{
[self.tabBarController setSelectedIndex:1];
}
A couple of comments:
My answer was predicated on the assumption that your tab bar works as expected when you tap on the buttons of the tab bar, itself. If you tap the buttons at the bottom of the screen, do you transition to your other views correctly and preserve the tab bar? If so, my answer above should solve your issues in getting the big buttons to work. If not, though, then the problem rests elsewhere and you need to show us your code that might account for that (either you're something non-standard in the UITabBarControllerDelegate methods, or your viewDidLoad of the view is doing something nonstandard).
If I understand your user interface design right, you have the tab bar at the bottom as well as the big buttons in the middle, which presumably do the same thing. That is, no offense, a curious user interface design (duplicative buttons, requiring extra tap on a button, etc.). You might want to choose to either use either big buttons (in which you can retire the tab bar, eliminate the IBAction code I've provided above, and just use a nice simple navigation controller and push segues, for example), or just use the tab bar (and lose the home screen, lose the big buttons, etc.).
You also made reference to "press back button", and I don't see any "back" button on any of your screen snapshots. Do I infer that you have a navigation controller and you're doing a pushViewController or push segue somewhere? If you're doing something with back buttons, you might need to clarify your question further.

Resources