iOS UIButton or Single Row UITableView For Dropdown Like Thing? - ios

For iOS 7 and iOS 8, we're implementing these things that look like drop-downs, but each just launch a modal window.
What makes more sense, using 3 UIButtons, 3 UITableViews with 1 row, or something else? In the past, there would be more than one of these all lined up, so I would put them in a UITableView and set the accessoryView of the UITableViewCell. Using the cell was nice, but three UITableViews seem like overkill here and a maintenance hassel.
The closest post I found regarding this was one about using an UITableViewCell outside of UITableView

What would make the most sense is to follow the iOS design guidelines. Instead of trying to create custom dropdown menus (or worse: showing a drop down menu, but displaying a modal view when the user is expecting a drop down view), that UI could be replaced with 1 UITableView that has 3 UITableViewCells in it. The text on each cell would be the name of the setting to be changed and selecting the cell would push segue to the next page. This will give the app a uniform iOS UX; allowing users to know exactly how to use your app because it works similarly to other apps on their phone. Check out the Settings app on the simulator to see what I am describing.

I don't see any advantage to using a UITableView or a UITableViewCell. I think this is clearly a case for three UIButtons. You can set constraints to keep them nice and clean. One cool thing that might be worth investigating is using a unicode character for the downward arrow. That way you could have the tap feedback on the whole "thing" as you called it.

When I need to create sort of dropdown menus, I usually take advantages from UITableView, one above all is when you will need to add one or more selections in the dropdown you just need to change the data model.
UITableViewCells are easily customizable that means that you can create almost everything you want.
I think that your design doesn't adapt well to a mobile application, those kind of menu are more web style, with 3 buttons and a UIPickerView you can really improve the user experience and also adapt in a really easy way on the ipad embedding the picker in a UIPopoverController.

as i agree with #keithbhunter, but still if you want then may this links will help you.
http://code4app.net/ios/DXPopover/54741ca3e24741c56db03ca0
https://www.cocoacontrols.com/controls/kxmenu
https://www.cocoacontrols.com/controls/nidropdown

Related

How are complex iOS screens made?

I'm trying my first steps in iOS development, and so far my app is going well. However, I've reached the point where simple UITableViews are just not cutting it.
For starters, I have a table view with two sections. I've implemented the method providing each section's title. But when I compare it to, for example, iOS's Settings screen, Apple's style (which I've seen implemented in other apps) looks much better, with better styling in the "section titles" and complex controls in the "table cells":
Now in my app, in some screens I would like to implement something similar to WhatsApp's settings screen. In this case, each "cell" does not have anything very noteworthy layout-wise, but I like the spacing between the different sections:
My last question is: when I am composing a cell, it is very clear to me how to implement a layout, its constraints, etc. Now imagine that I want to show a Table View showing a list of teams, and for each team I want to show the team players underneath, one player by line. It is not yet clear to me how I define layout contraints with an arbitrary number of elements. How would I approach doing this? Grid inside cell?
To sum it all up, my question is: are these screens TableViews with fancy styles and cells and more complex implementations? Or a different View that I am not aware of? Or even an empty canvas that they then compose "by hand"?
For context, I am developing with XCode 9, Swift, on a project with storyboards.
They are custom UITableViewCell cells (like the volume and profile avatar) or standard cell prototypes (WhatsApp settings are UITableViewCellStyleDefault with cell.imageView.image set.

TVOS about App layout (Like in iTunes and similar)

I have played a lot with my app and I do not understand how to make layout like in for example iTunes (also many apps uses it).
How it is made? It is one big CollectionView, but with special Flow or it is TableView with many CollectionView?
Collection headers. In iTunes App if I select item (with adjustImageWhenFocused) under the header then the header will jump up and the item will not overlap the header. It is special magic or it is system behavior and I just do know how to use it?
Below is two screenshots about what I am trying to tell you and example with my app.
In iTunes there are movie preview page. With what type of View it is made? TableView,CollectionView or just ViewController with ScrollView?
I have read many sources and looked up demo projects, but nowhere I have found answers for this questions.
1) I think it would be a stackTemplate containing a couple collectionLists.
2) AFAIK the headers "jump up" on their own, no need to prepare anything special.
3) productTemplate?
For examples, see https://github.com/iBaa/PlexConnectApp, /TVMLTemplates/Default/Movie_OnDeck.xml (1) or Movie_PrePlay.xml (3).
Or check the gold source: https://developer.apple.com/library/tvos/documentation/LanguagesUtilities/Conceptual/ATV_Template_Guide/StackTemplate.html, plus other Templates.
If you want to use native Swift way it can be achieved in following ways:
You can use table view and have collection view within each cell. I am using same approach to achieve this.
We have focus update delegate from there you can find the focused frame of image view. With the help of focused frame and label frame you can check if they are intersecting or not. Based on that you can move label up and down.
This is native TVML template, in order to achieve in swift you need to create view using tableview and collection view.

Which UI element is suitable for drop down filter in iOS app?

Right now i am developing app. One of it's ViewControllers has tableview with list of blog posts. I want to put some control so user can select blog's categories and then app will show posts only from those selected categories.
I thought it would be nice if there will be "filter" button in top right corner of my app's viewcontroller. After pressing it dropdown list of category appears and user can select categories.
What custom UI element can handle it?
Really there's a ton of options at your disposal, not including all the custom elements you can probably grab from GitHub
For an iPad, you can use a UIPopoverController https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIPopoverController_class/index.html
Depending on the number of filters and the style of the design, a good starting point could even be a UIActionSheet.
If you want to do something really fancy, you could have a second UITableView hidden underneath by your main UITableView containing the blog posts, and then when the "Filter" button gets hit you can animate your blog UITableView slightly over revealing your filters menu (maybe even shaded slightly darker to give a feeling of depth to the app)
I searched for a while and can recommend CZPicker https://github.com/chenzeyu/CZPicker because it very nice and easy picker view for iOS that supports iOS 7 and is well working not only iPhones but whit iPads too.

ios cocoa: How to adjust the size of the popover depending on the number of rows in uitableview

This is related to this question
ios filter options similar to the apple store (dropdown list)
I tried using a uitableviewcontroller instead of a pickerview as I couldn't understand how to use the picker view if I need it popping out (any info on it would be appreciated).
Now this is what I did.
I have a VC that calls out a "FilterVC". I only have one FilterVC that is called by 3 different "filter buttons", and I will just populate the VC depending on the button. The issue is, one button might have just 2 items that is needed to be shown, another one might containg up to 50. Was wondering how do I adjust the height of the popovercontroller that contains the uitableview? Also, is this the right way in dealing with popovers, 3 segues connected to one VC??? (It needed an anchor point)
Here's what it looks like
As a follow up question:
Is this the right way to do it on an ipad? I feel like most people prefer the uipicker. The guy that answered my first question said it's more of a design thing. Now since I'm no designer, as a user, do you think uitableview is more appealing?
Thanks for your time!!
In the view that you're showing in the popover, set self.contentSizeForViewInPopover as soon as you know the size and before the view is displayed.
The main benefit of using a table view over a picker is that it has a scroll indicator so you can see how long the list of options is. Also obviously that you can control exactly how the list is displayed. So the table view should be better if it fits in with your UI style and particularly if the list of options is long.

iphone/ipad how to handle lots of input fields?

I'm writing a app that contains quite a bit of input fields for collecting data.
and im wondering what are some good methods to display these kind of input fields, if there are too many to fit on a screen? so something like the add contact screen... where u can scroll down and there are fields there
my initial idea is to put them in a scroll view and then i can scroll through them, is there a tutorial to do this? it seems like the scroll view is more for dynamically displaying data like a text view, and not for static forms like i was describing.
if anyone has any different methods for doing this please post.
UITableview will match perfectly for what you need.
My friend wrote this which is a container view that automatically helps with moving fields out of the way of the keyboard - It will certainly save you some time if you don't want to use a UITableView:
https://github.com/mackross/GTKeyboardHelper
The other way as H2CO3 suggested is to use a UITableView. If it is a UITableViewController, then you get the moving out of the keyboards way automatically. You could build custom table view cells that are styled to have a prompt and a UITextField for input. You can also set the selectionStyle to UITableViewCellSelectionStyleNone to prevent these cells from highlighting when selected.
I think the third way is to do this with a UINavigationController (or a UIPageControl) and build a kind of wizard, where you go through various pages of related data. This might be the neatest way depending on how many fields you have and if you can group data into common sets (e.g. personal information, work information etc)
I had the same problem and found GTKeyboardHelper to be an easy way out.
After drag and drop the framework in your project, include the header file.
Download and open the example project, then drag the "Keyboard Helper" object from the objects section in the xib to the objects section in your project's interface builder.
Drag and drop all your views to be children of the "Keyboard Helper".

Resources