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
218
votes
18 answers

How can I tell when UITableView has completed ReloadData?

I am trying to scroll to the bottom of a UITableView after it is done performing [self.tableView reloadData]. I originally had [self.tableView reloadData] NSIndexPath* indexPath = [NSIndexPath indexPathForRow: ([self.tableView…
Alan
  • 9,331
  • 14
  • 52
  • 97
217
votes
26 answers

Detecting which UIButton was pressed in a UITableView

I have a UITableView with 5 UITableViewCells. Each cell contains a UIButton which is set up as follows: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *identifier =…
rein
  • 32,967
  • 23
  • 82
  • 106
214
votes
24 answers

Resizing UITableView to fit content

I am creating an app which will have a question in a UILabel and a multiple choice answers displayed in UITableView, each row showing a multiple choice. Questions and answers will vary, so I need this UITableView to be dynamic in height. I would…
MiMo
  • 4,905
  • 3
  • 22
  • 23
214
votes
2 answers

How to fix UITableView separator on iOS 7?

UITableView draws with ragged lines on iOS 7: How to fix it? The line between cells should be on the full width of the screen.
Dmitry
  • 14,306
  • 23
  • 105
  • 189
213
votes
18 answers

Custom Cell Row Height setting in storyboard is not responding

I am trying to adjust the cell height for one of the cells on my table view. I am adjusting the size from the "row height" setting inside the "size inspector" of the cell in question. When I run the app on my iPhone the cell has the default size set…
zirinisp
  • 9,971
  • 5
  • 32
  • 38
196
votes
10 answers

Long press on UITableView

I would like to handle a long press on a UITableViewCell to print a "quick access menu". Did someone already do this? Particularly the gesture recognize on UITableView?
foOg
  • 3,126
  • 3
  • 19
  • 18
193
votes
3 answers

Table Header Views in StoryBoards

Is there a way to insert a Table Header View (tableHeaderView) in StoryBoard (like we used to do in Interface Builder)?
Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196
191
votes
18 answers

How to customize the background color of a UITableViewCell?

I would like to customize the background (and maybe the border too) of all of the UITableViewCells within my UITableView. So far I have not been able to customize this stuff, so I have a bunch of white background cells which is the default. Is there…
jpm
  • 16,622
  • 34
  • 63
  • 66
189
votes
9 answers

Is it possible to refresh a single UITableViewCell in a UITableView?

I have a custom UITableView using UITableViewCells. Each UITableViewCell has 2 buttons. Clicking these buttons will change an image in a UIImageView within the cell. Is it possible to refresh each cell separately to display the new image? Any help…
Wizard Of iOS
  • 2,389
  • 2
  • 18
  • 22
185
votes
7 answers

Class has no initializers Swift

I have a problem with Swift class. I have a swift file for UITableViewController class and UITableViewCell class. My problem is the UITableViewCell class, and outlets. This class has an error Class "HomeCell" has no initializers, and I don't…
Kevin Py
  • 2,459
  • 2
  • 22
  • 33
181
votes
6 answers

Pull to refresh UITableView without UITableViewController

I'm trying to implement a pull to refresh feature in a UITableView within a UIViewController. I can't use a UITableViewController because I want the UITableView to be a smaller subview in the view controller, with some other stuff above it. I assume…
Daniel Robinson
  • 3,347
  • 2
  • 18
  • 20
180
votes
16 answers

How to Implement Custom Table View Section Headers and Footers with Storyboard

Without using a storyboard we could simply drag a UIView onto the canvas, lay it out and then set it in the tableView:viewForHeaderInSection or tableView:viewForFooterInSection delegate methods. How do we accomplish this with a StoryBoard where we…
Seamus
  • 3,191
  • 3
  • 22
  • 20
180
votes
12 answers

Having a UITextField in a UITableViewCell

I'm trying to do that for a couple of days now, and after reading tons of messages of people trying to do that too, I'm still unable to have a fully working UITextField in some of my UITableViewCells, just like in this example: Either I have the…
Mathieu
  • 1,984
  • 4
  • 13
  • 16
178
votes
32 answers

Remove empty space before cells in UITableView

I am currently trying to put a UITableView in a different location rather than at the top of my view controller. With this said, it is trying to add the header in the top to account for the navigation bar, but this is not needed since I do not have…
hetelek
  • 3,776
  • 5
  • 35
  • 56
177
votes
20 answers

UITableViewCell subview disappears when cell is selected

I'm implementing a color-chooser table view where the user can select amongst, say, 10 colors (depends on the product). The user can also select other options (like hard drive capacity, ...). All color options are inside their own tableview…
Cyrille
  • 25,014
  • 12
  • 67
  • 90