Eureka: Changing ButtonRow title.

Created on 7 Feb 2016  路  5Comments  路  Source: xmartlabs/Eureka

Is it possible to change the title of a ButtonRow while running?
Setting the title of the row on 'cellUpdate' doesn't work.

ButtonRow question

Most helpful comment

@AlexCatch

let row: ButtonRow = ....
row.title = "your button title"
row.updateCell() 

Using the master branch version you can also use row.reload() instead of updateCell() in case you are not running another reload.

Please read this guide before contributing: https://github.com/xmartlabs/Eureka/blob/master/CONTRIBUTING.md

Regards

All 5 comments

@AlexCatch

let row: ButtonRow = ....
row.title = "your button title"
row.updateCell() 

Using the master branch version you can also use row.reload() instead of updateCell() in case you are not running another reload.

Please read this guide before contributing: https://github.com/xmartlabs/Eureka/blob/master/CONTRIBUTING.md

Regards

The code above doesn't seem to work.
Is assigning it to a variable necessary for it to update successfully?

form.rowByTag("addOrganisation")!.title = name form.rowByTag("addOrganisation")!.updateCell()

This code still doesn't work. (or is broken again.).

if let recipientsRow : ButtonRow = self.form.rowBy(tag: "Recipients") as? ButtonRow{
   recipientsRow.title = "\(self.selectedRecipients.count) recipients"
    recipientsRow.updateCell()
    recipientsRow.reload()
    self.tableView.reloadData()
}

I have tired every permutation of the update/reload commands singularly and in combinations. The title does now update.

Have you set a breakpoint to see that the code inside the if is actually executing?

This code works in the ViewController of the Examples

let r = form.rowBy(tag: "Plain Table View Style")
r?.title = "Lalalalala"
r?.updateCell()

I fixed it this afternoon, and was going to follow up.. I was generating the form on viewDidAppear.. When I was popping back from the other VC a duplicate form was generated. Recipients row was posting to the old one, while the new one was being displayed.

Was this page helpful?
0 / 5 - 0 ratings