Add Information / Details to a TableView row

uitableview add row dynamically swift
custom uitableviewcell swift programmatically
uitableview prototype cells not showing
add data to table view swift
uitableview with multiple custom cells tutorial
connect a prototype cell in a storyboard
custom prototype cell (swift)
tableview javafx

I have a TableView with items on the first ViewController. When I click on a row i perform a segue to display a second ViewController with a TextField on it. Now i want to write Informations to the TextField and link that information to the selected row from the first ViewController. So that Information1 is shown when you click row1 and Information2 is shown when you click row2 and so on. I dont want to have as many ViewControllers as Items, so Im wondering what the best way would be to solve this?

declare a global public var content:String? in your destination View Controller

in func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) of your parentViewController, write this before performing segue:

let destVC = YourDestinationVC()
destVC.content = "content pertaining to cell selected"

// if the segue name is called segueOne
destinationVC.performSegueWithIdentifier("segueOne", sender: self)

This will perform the segue with preloaded Data

Add Rows to Table View iOS Tutorial, Inside Table Views the data is displayed using rows. These rows can be manipulated, in this tutorial we will add some rows using user input. The JavaFX TableView control enables you to show a table view inside a JavaFX application. This JavaFX TableView tutorial explains how to create a TableView, add table columns and display rows of data objects inside the TableView.

As I understood your question is more about how to design your app so as its easy to maintain. Here is my suggestion:

//1. Create a structure to hold the data
struct Information{
    let cellTitle : String
    let messageToDisplay : String

    init(cellTitle: String, messageToDisplay: String){
        self.cellTitle = cellTitle
        self.messageToDisplay = messageToDisplay

class ViewController: UIViewController {

    @IBOutlet weak var tableView: UITableView!

    //2. Create a datasource array
    let datasource : [Information] = [Information(cellTitle: "Cell1", messageToDisplay: "Message To Display on for Cell1"),
                                    Information(cellTitle: "Cell2", messageToDisplay: "Message To Display on for Cell2"),
                                    Information(cellTitle: "Cell3", messageToDisplay: "Message To Display on for Cell3")]

    override func viewDidLoad() {

extension ViewController : UITableViewDelegate{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){
        performSegue(withIdentifier: "ShowSecondViewController", sender: self)

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        let indexPath = tableView.indexPathForSelectedRow

        if segue.identifier == "ShowSecondViewController" {
            let vc = segue.destination as! SecondViewController
            //3.0 Create a variable in your destination Viewcontroller and set it here
            vc.messageToShow = datasource[(indexPath?.row)!].messageToDisplay


Configuring the Cells for Your Table, Design your cells to ensure that the most important information stands out. Xcode provides one prototype cell for each table, and you can add more prototype In the tableView(_:cellForRowAt:) method of your data source, use your cell's� Add new row to TableView. import javafx.application.Application; import; import javafx.collections.FXCollections; import

You need only 1 vc as the destination of segue with a variable that you set from prepare method

let arr = [YourModel(name:"ppp",age:11),YourModel(name:"ppp",age:14)]

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    performSegue(withIdentifier: "YourSegue", sender: arr[indexPath.row])

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "YourSegue" {
        let des = segue.destination as! DetailVC
        des.item = sender as! YourModel


struct YourModel {
    let name: String
    let age: Int 

class DetailVC:UIViewController { 
   var item:YourModel?

Filling a Table with Data, The table view arranges your views onscreen and works with your data data in a way that makes it easy to retrieve the row and section information. To add more prototype cells, select the table view and update its Prototype Cells attribute . where selectedIndex is the index in the TableView interested. Extend from last article of " Embed Button in TableView ", implement EventHandler of the embedded button, th read data of the selected row and display on another TableView within dialog.

Using JavaFX UI Controls: Table View, such as adding a table, populating the table with data, and editing table rows. Example 12-1 defines three columns to store the following information in an� Instead of the meal detail scene with its text field, image view, and rating control, you should now see an empty table view—a screen with a number of horizontal dividers to separate it into rows, but with no content in each row.

Swift UITableView - Insert and Delete Rows - Tutorial, In this Swift Tutorial I show you how to dynamically insert a row into a UITableView as Duration: 8:13 Posted: 29-Jun-2017 12 Table View. In this chapter, you learn how to perform basic operations with tables in JavaFX applications, such as adding a table, populating the table with data, and editing table rows.

JavaFX, This is the second video of TableView Tutorial. JavaFX - Adding Data in TableView (Using Duration: 12:38 Posted: 09-Oct-2017 TableView handles scrolling and laying out rows in attractive sections, a common need for the above scenarios. The TableView control uses each platform's underlying equivalent view when available, creating a native look for each platform. Structure. Elements in a TableView are organized into sections.

  • Could you explain what "item" is in the line des.item = sender as! YourModel ?
  • Thank you for your patience. Maybe i was not clear enough, because i want to show information entered by the user into the TextView, not given infos by an array. But i have the basics now from you guys and I will have a closer look by myself now first. Thank you.