Created
April 7, 2015 03:02
-
-
Save angelobelchior/d6a0df09b4b798e59a6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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