Skip to content

Commit

Permalink
Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
onegray committed May 3, 2015
1 parent e85679e commit 52af265
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WKInterfaceTable extensions (Swift)
A couple of helpers to manage WatchKit table cells without indices.
A couple of helpers to manage WatchKit table rows without indices.

#### Overview
`WKInterfaceTable` is so simple, as the following trivial usage instructions:
Expand All @@ -13,29 +13,29 @@ Use the `builder` object to describe table structure:

var builder = WKInterfaceTable.Builder()

Add some cell definitions:
Add some row definitions:

builder.addCell("RowTypeId") { (cell: CellController) -> Void in
// Configuration closure to setup and fill cell data
// Called just after cell is created
cell.label.setText("Hello table")
builder.addRow("RowTypeId") { (row: RowController) -> Void in
// Configuration closure to setup and fill row data
// Called just after row is created
row.label.setText("Hello table")
// Or store cell reference for future access
self.certainCell = cell
// Or store row reference for future access
self.certainRow = row
}


Finally, apply the results to a `WKInterfaceTable` object:

builder.instantiateTableCells(table)
builder.instantiateTableRows(table)


#### Handle row selection

Bind selection handler to the target `cell`:
Bind selection handler to the target `row`:

WKInterfaceTable.setDidSelectHandler(cell) {
NSLog("Cell Clicked")
WKInterfaceTable.setDidSelectHandler(row) {
NSLog("Row Clicked")
}


Expand Down

0 comments on commit 52af265

Please sign in to comment.