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.