Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 1.52 KB

passing-data.md

File metadata and controls

34 lines (26 loc) · 1.52 KB

Passing Data

Learn how to pass parsed data from your table view

Within your ALTableView instance, there's a property called array. This represents the parsed array of models that populates your view.

For example, here's how you push the data of the cell the user has just tapped:

Objective-C Swift

  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    let table = tableView as! ALTableView
    let item = table.array[indexPath.row]
    // You're good to go.
  }

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  NSDictionary *item = self.tableView.array[indexPath.row];
  // You're good to go.
}

NOTE: If you specify your own model class in interface builder, then you'll receive an array of objects from that custom class instead of an array of dictionaries.