Skip to content

Instantly share code, notes, and snippets.

@DevGW
Last active April 5, 2023 14:37
Show Gist options
  • Save DevGW/ab84144bb549e34dbdcef8b1cd55368c to your computer and use it in GitHub Desktop.
Save DevGW/ab84144bb549e34dbdcef8b1cd55368c to your computer and use it in GitHub Desktop.
Objective-C :: UITableView Methods #objc
#pragma table view methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return <#number of sections#>
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return <#number of rows in section#>
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return <#row height#>
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString* cellIdentifier = @"CellIdentifier";
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
cell.textLabel.text = @"";
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment