ded ded - 1 year ago 117
Swift Question

How to add label text to DetailDisclosureButton?

I'm working in a iOS Swift 2.0 application. I can't figure out for the life of me on how to set the text on the right side of a

just before the disclosure indicator chevron (besides creating a custom

Here is a screenshot of the "Settings app" doing exactly what I'm trying to achieve.

cell accessory view screenshot

Answer Source

In Interface Builder, when setting up your cell, select the Right Detail style:

Right Detail

Then assign the value to the detailTextLabel property:

cell.detailTextLabel.text = "Kilroy Was Here"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download