Questions tagged [uitableview]

UITableView is a class used for displaying and editing lists of information on iOS. A table view displays items in a single column. UITableView is a subclass of UIScrollView, which allows users to scroll through the table, although UITableView allows vertical scrolling only.

UITableView is a class used for displaying and editing hierarchical lists on iOS () and watchOS (). It uses an efficient architecture that reuses existing UITableViewCell objects while they scroll offscreen, improving memory usage and performance during fast scrolling.

Sample of Use

Sample of Use

Resources:

64456 questions
87
votes
6 answers

iPhone: Show modal UITableViewController with Navigation bar

I am showing a modal view which is a UITableViewController class. For some reason it won't show the navigation bar when I show it. Here is my code: SettingsCreateAccount *detailViewController = [[SettingsCreateAccount alloc]…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
87
votes
7 answers

Swipe-able Table View Cell in iOS 9

I want my table list to have a swipe-able menu like in iOS 8 (first introduced in iOS 7). I've found a Ray Wenderlich guide that is clear on how to do it, but it was written a year and 4 months ago and the code is in Objective-C. Did iOS 8 or the…
Dave G
  • 12,042
  • 7
  • 57
  • 83
87
votes
6 answers

NSIndexpath.item vs NSIndexpath.row

Does anyone know the difference between NSIndexpath.row and NSIndexpath.item? Specifically, which one do I use in: -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
Cyberpass
  • 1,145
  • 1
  • 7
  • 13
87
votes
10 answers

Custom UITableViewCell selection style?

When I click on my UITableViewCell, the background part (the areas that my background image doesn't cover) turns blue when I click on the cell. Also, all of the UILabels on the cell turn to white when it is clicked which is what I want. However what…
SimplyKiwi
  • 12,376
  • 22
  • 105
  • 191
87
votes
22 answers

iPhone: Hide UITableView search bar by default

I used the Interface Builder to create a table view, to which I added the library's Search Bar and Search Display Controller to add search functionality. However, IB set it up so that the bar is visible at the top of the screen when the view is…
Tim
  • 59,527
  • 19
  • 156
  • 165
86
votes
12 answers

disable the uitableview highlighting but allow the selection of individual cells

when you tap on a cell the row gets selected and highlighted.Now what i want to do is disable the highlighting but allow the selection.Is there a way around it.There is question that answers this but it disables both the selection and highlighting.
soldiershin
  • 1,612
  • 1
  • 18
  • 29
85
votes
4 answers

Using [UIColor colorWithRed:green:blue:alpha:] doesn't work with UITableView seperatorColor?

I'm trying to configure a dark gray seperator color. Why does the following do nothing? self.tableView.seperatorStyle = UITableViewCellSeperatorStyleSingleLine; self.tableView.seperatorColor = [UIColor colorWithRed: 127 green:127 blue:127…
skålfyfan
  • 4,931
  • 5
  • 41
  • 59
85
votes
16 answers

Hide remove separator line if UITableViewCells are empty

I have a UITableView and I have only 3 rows in it, and I can see those 3 rows. The problem is the cells that are empty: I can see lines there. I don't want to see those lines. Any idea how to remove those lines? Below is image for what I am looking…
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
84
votes
10 answers

Getting row of UITableView cell on button press

I have a tableview controller that displays a row of cells. Each cell has 3 buttons. I have numbered the tags for each cell to be 1,2,3. The problem is I don't know how to find on which cell a button is being pressed. I'm currently only getting the…
minimalpop
  • 6,997
  • 13
  • 68
  • 80
83
votes
6 answers

UISwitch in a UITableView cell

How can I embed a UISwitch on a UITableView cell? Examples can be seen in the settings menu. My current solution: UISwitch *mySwitch = [[[UISwitch alloc] init] autorelease]; cell.accessoryView = mySwitch;
testing
  • 19,681
  • 50
  • 236
  • 417
83
votes
19 answers

why UITableViewAutomaticDimension not working?

Hi there is plenty of question answering the dynamic height for UITableViewCell of UITableView. However I find it weird when I did it. here's are some of the answer : here and here usually this would answer the dynamic height for…
CaffeineShots
  • 2,172
  • 7
  • 33
  • 58
83
votes
9 answers

swift UITableView set rowHeight

I am trying to set the height of each row in the tableView to the height of the corresponding cell with this code: override func tableView(tableView: UITableView!, heightForRowAtIndexPath indexPath: NSIndexPath!) -> CGFloat { var cell =…
tim_yng
  • 2,591
  • 4
  • 18
  • 20
83
votes
6 answers

Setting style of UITableViewCell when using iOS 6 UITableView dequeueReusableCellWithIdentifier:forIndexPath:

I'm trying to work out how to set the UITableViewCellStyle when using the new methods in iOS 6 for UITableView. Previously, when creating a UITableViewCell I would change the UITableViewCellStyle enum to create different types of default cells when…
Zack Brown
  • 5,990
  • 2
  • 41
  • 54
82
votes
16 answers

UITableViewCell: rounded corners and shadow

I'm changing the width of a UITableViewCell so that the cell is smaller but the user can still scroll along the edges of the tableview. override func layoutSubviews() { // Set the width of the cell self.bounds =…
user3857868
82
votes
9 answers

How to detect tableView cell touched or clicked in swift

I'm trying to get index of selected item in TableView and start some activity after that. Unfortunately most of solutions that I found are in objective-c or do not work. Method func tableView(tableView: UITableView, didSelectRowAtIndexPath…
pawisoon
  • 1,427
  • 1
  • 15
  • 20