What UI Component to make multiple and separated box like this? - ios

I just want to know what components to make this multiple and separated box like you can see here below, of course with each row can be tapped so that it can show something on next screen. thank you.

This is simply a UITableView with multiple sections. You will have to configure your dataSource to specify the number of sections in – numberOfSectionsInTableView:. – tableView:cellForRowAtIndexPath: and – tableView:numberOfRowsInSection: will also have to properly handle your data/UI structure.
As mentioned by rmaddy in the comments below, the tableview in your image has its style property set to UITableViewStyleGrouped.

Related

How to use collapse option to display list of users

How to design and code this in swift(IOS) AND Xcode.If we tap on down button it should display items and vice-versa like this:
You need a Collapsable TableView. In order to achieve that, in your TableView you must keep track of which sections are collapsed (contracted) and which of them are expanded. For this you need to maintain a set of indices of sections that are expanded, or a boolean array where the value of each index indicates if the corresponding section is expanded or not. Check for the values at the specific index while assigning height to a certain row. Check this link for more help.
Refer ans by #Cristik.Refer my previous ans for more info.
You need expandable table view. Basically, you need to control the open and close of sections of your table view.
Here is an good example with working code & animation written in swift 3.0

Design event view using swift

i want to make a view for event details, using swift, something like this one:
what do you suggest me to use? tableview? collectionview? every events has a different numbers of rows and every row can have a different height, example based on text.
Is there some example on the web?
Thanks!
I suggest a tableView and everything row should be in section.
Sections:
image section
action section
date section
and so for forward. For the sections you can use and enum so you don't use directly ints. Then every section has one row usually. The final design should result pretty clean.

How to make my own UIPickerView?

Since UIPickerView can't be customized to the level I want (without taking a risk by hiding specific subviews), I need to roll my own to select a time.
I figure I can do this using two UITableViews, but I'm unsure of how to do 2 things:
1) How do I determine which cell is in the middle of the view (i.e. which one did the user select)?
2) How do I make the table snap to the cell nearest to the middle of the view once the user has stopped scrolling?
Thanks for your help.
Why do you say that UIPickerView can't be customized?. It has a bunch of delegate methods made to allow a lot of customization, such as view for rows, height for rows etc etc..
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPickerViewDelegate_Protocol/Reference/UIPickerViewDelegate.html
Implement the delegate in your ViewController and customize it as you want.
You're just trying to select a time? Then use UIDatePicker. It is a picker view for time/date.
Depending on the type of customisation that you want, you might not need to make your own UIPickerView. You can return your own views for each component using UIPickerViewDelegate. Check pickerView:viewForRow:forComponent:reusingView:
The free Sensible TableView framework has a UITableView based date picker that you could use out of the box. Should save you a lot of time as it handles all the scrolling and table view resizing. Hope this helps.

UITableView with multiple sections and a UIButton

I have a UITableView with two sections. Each section has a few UITableViewCells. I'd like to put a UIButton between the first section and the second section. Should the button be in it's own section? or perhaps in the third cell of the first section?
Edit #1: perhaps it's easiest to just use add another section with a single cell and style it like a button?
Well, that depends on how it's set up and how you want it to look. If you're in a plain table, I think it shouldn't really matter because there's no space between sections. If you're using a grouped table, it's probably easiest and best-looking to put the button in its own section.
You can put it in either its own section or in a cell. How you display the button visually (and its semantic meaning) might affect your choice.

How to display multiple objects in a single row in my UITableVIew?

I want to display three items in my UITableView's row. What should be best and efficient way to do this.
Any suggestions?
Thanks,
Take a look at this example:
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
It shows you how to customize many aspects of a UITableView (and cells too).

Resources