Skip to content

Instantly share code, notes, and snippets.

@angelobelchior
Created April 7, 2015 03:02
Show Gist options
  • Save angelobelchior/d6a0df09b4b798e59a6a to your computer and use it in GitHub Desktop.
Save angelobelchior/d6a0df09b4b798e59a6a to your computer and use it in GitHub Desktop.
public class TableViewSource : UITableViewSource
{
private List<string> _repositories;
public TableViewSource(List<string> repositories)
{
_repositories = repositories;
}
public override int RowsInSection (UITableView tableview, int section)
{
return _repositories.Count;
}
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
{
var cell = tableView.DequeueReusableCell("TableViewCell");
if(cell == null)
cell = new UITableViewCell(UITableViewCellStyle.Default, "TableViewCell");
cell.TextLabel.Text = _repositories[indexPath.Row];
return cell;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment