samedi 29 avril 2017

iOS swift 3 after checkbox is checked select label name

How would one go about selecting the text from a label name after checking a nearby checkbox? Say you place a label named "Whole Wheat" next to a checkbox and when the image in the checkbox changes to checked, the text from the label -- WholeWheat -- would be stored in a variable or otherwise be made available for use elsewhere.

Mostly know how to retrieve values from labels and textfields, just not by limiting selections to those associated with checked boxes.

Steps taken so far include creating standard checkbox class with checked and unchecked image, adding various functions such as

func configure(_ label: String) {

and

a couple renditions of isSelected,

and placing print statements everywhere imaginable, all with nil outcomes or worse. Using Xcode 8.3.1 and Swift 3. Any help would be much appreciated.




Aucun commentaire:

Enregistrer un commentaire