Return a UITableViewCell for the item at index_path

By default, we assume that all items are in a single section. So no matter the depth of the index_path, this returns a cell with the view at index part of index_path.

iOS callback: cellForRowAtIndexPath

Property definitions

ios $ TableView :: cell_for_row_at_index_path
	# Return a `UITableViewCell` for the item at `index_path`
	#
	# By default, we assume that all `items` are in a single section.
	# So no matter the depth of the `index_path`, this returns a cell with
	# the view at index part of `index_path`.
	#
	# iOS callback: `cellForRowAtIndexPath`
	protected fun cell_for_row_at_index_path(table_view: UITableView, index_path: NSIndexPath): UITableViewCell
	do
		var reuse_id = "NitCell".to_nsstring
		var cell = new UITableViewCell(reuse_id)

		# TODO if there is performance issues, reuse cells with
		# the following code, but clear the cell before use.

		#var cell = table_view.dequeue_reusable_cell_with_identifier(reuse_id)
		#if cell.address_is_null then cell = new UITableViewCell(reuse_id)

		var index = index_path.index_at_position(1)
		var view_native = get_view_from_native_list(table_view, index)
		var cv = cell.content_view
		cv.add_subview view_native

		return cell
	end
lib/ios/ui/ui.nit:571,2--595,4