iPhone SearchBar with Buttons Underneath? - iphone

How would one implement a search field like the one used on the iPhone Mail application. When you attempt to search it shows up 4 buttons under the search bar with the fields you can search. The search bar actually moves up to cover the navigation bar and exposes those buttons.
I'd like to do something similar in my application where you can specify what exactly you are searching for. I think the mail search is a little difference since it also has a cancel button?
How would you accomplish this and what components would you use?

Do you mean the so called ScopeBar? Use a SearchDisplayController and there you could set the scopes of the ScopeBar.
Or drag a normal UISearchBar on your view, and the with the inspector you are able to set the scope items.

Related

Making a drop down list using swift3

I am new to Xcode and the Swift3 language, so can anyone please direct me on how to implement the drop down list in swift3?When I click uibutton open dropdown list.i use three type of button first one is "country" second "city" and third "locality".
I think the best way to implement a dropdown list in iOS is to use a UITableView. In your example you could create one programmatically and add it to the right place on the screen.
Or have one hidden and bring it from / make it visible when tapping the button.
One think about that though, it is not the best UX/UI to have drop down menus in an iOS app. Apple provides a lot of native elements that would do a similar job.
Example 1: Use a modal that has a UITableView (fullscreen or part of the screen) and make it disappear on selection.
Example 2: Use a UIPickerView
In case you still want to stay with that design use something like
https://github.com/AssistoLab/DropDown
I bet if you do a quick googling you'll find more libraries that do something similar

Is it ok to use the official iPhone compose icon on the tab bar of my app?

I have a tab bar for my app. One of the tab is an "action" tab for which I would like to use the official iPhone compose icon here as the tab item icon, is it allowed?
It is allowed provided you use it they way it was intended to be used. So if it is used to initiate a "compose" feature it would be allowed.
Apple will not hesitate to reject an app if any of their icons are used in unintended or nonstandard ways - and will site their HIG. So if you aren't sure, I would suggest just creating something very similar yourself.
The compose item is a bar button system item, not a tab bar item. I think you will run into HIG issues with it - it is typically used to summon a modal controller for you to create an item (usually a message).
That doesn't really fit as a tab bar item, which suggests a view of information that you can switch into or out of at any time.
In addition, the graphic may not be in the correct proportion or have the right properties to use in a tab bar.

UISearchBar - what is "search results button" for?

(Duplicate of this question, but I figured I could try again, since that one wasn't answered...)
The UISearchBar on the iPhone has an option showsSearchResultsButton. When you turn it on, it shows a button with horizontal lines inside the search bar, and you can implement a callback that will be called when the user presses it.
The thing is, I can't find a single place on the Internet where it says what the intended purpose of this button is. I know I could make it do anything, but I'd like to know what it's actually for. Should it show a history of searches, or all items without filtering, or what?
It's simply to show search results when tapped.
Where Apple uses this is in their iPad App Store application. If you go to the Categories tab you'll see various app categories. Search for an item, you'll get a list of results, and when you press "Done" you are shown the categories screen again. Your previous search term is still listed in the search field, but now the Search Results Button appears in the field. After tapping this, a UIPopOver is displayed, showing a text list of the results from your last search.

Sending user to view from search results

I'd like to implement a search into my app. I'm planning to use a left swipe, like the Spotlight search. Would that violate anything with Apple?
My app is tableview based. The user can drill down a few levels before reaching a detail view. I'm considering two options for implementing the search:
1.) From the search results, I display lower level topics. Meaning, once a user clicks a search result, they will open a detail view. Should I back the user out of the search, navigate the UI down to the detail view...or just show the detail view (option #2)?
2.) If I just popup the detail view, it will be out of context. Once finished with the detail view, the user will not be able to navigate backwards to the top level. They will basically already be there (search results). Or is that how it should be - just put the user back on the search results view?
I don't know if it'd get rejected, but it sounds weird as I've never seen it in an app before. Why not just put the search bar in the first row of the table as in the iPod app?
You probably could also mimic the iPod behavior when "backing out" of Search results.
But yeah, this isn't really programming related.

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.