Skip to content

Instantly share code, notes, and snippets.

@aGupieWare
Created November 11, 2014 00:10
Show Gist options
  • Select an option

  • Save aGupieWare/6a26fe87d6b72d51ee18 to your computer and use it in GitHub Desktop.

Select an option

Save aGupieWare/6a26fe87d6b72d51ee18 to your computer and use it in GitHub Desktop.
Swift client, override boilerplate methods . . .
override func numberOfSectionsInTableView(tableView: (UITableView!)) -> Int {
// Return the number of sections.
return 1
}
override func tableView(tableView: (UITableView!), numberOfRowsInSection section: Int) -> Int {
// Return the number of rows in the section.
return self.dataSource.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell : UITableViewCell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
var supplyItem : PlumbingSupplyItem = self.dataSource[indexPath.row]
cell.textLabel.text = supplyItem.bsn_name;
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment