Eureka: How present my own view controller when clicking the row either push or present ?

Created on 14 Mar 2017  路  3Comments  路  Source: xmartlabs/Eureka

awaiting response question

Most helpful comment

You can push or present your own view controller like this, as shown in Eureka example :

<<< ButtonRow("Rows") {
     $0.title = $0.tag
     $0.presentationMode = .segueName(segueName: "RowsExampleViewControllerSegue", onDismiss: nil)
}

or by .onCellSelection closure like this :

<<< LabelRow () {
     $0.title = "LabelRow"
     $0.value = "tap the row"
}
 .onCellSelection { cell, row in
     self.performSegue(withIdentifier: "yourSegue", sender: self)
}

Hope this helps you.

All 3 comments

You can push or present your own view controller like this, as shown in Eureka example :

<<< ButtonRow("Rows") {
     $0.title = $0.tag
     $0.presentationMode = .segueName(segueName: "RowsExampleViewControllerSegue", onDismiss: nil)
}

or by .onCellSelection closure like this :

<<< LabelRow () {
     $0.title = "LabelRow"
     $0.value = "tap the row"
}
 .onCellSelection { cell, row in
     self.performSegue(withIdentifier: "yourSegue", sender: self)
}

Hope this helps you.

<<< ButtonRow("Name and Surname") { (row: ButtonRow) -> Void in
                row.title = row.tag
                row.presentationMode = .show(controllerProvider: ControllerProvider.callback(builder: { _ in return NameAndSurnameController() }),
                    onDismiss: nil
                )
}

Closing this, thanks guys for your answers!

Was this page helpful?
0 / 5 - 0 ratings