2

I am trying to understand Bond, so I made a test project. Here I am using a class chocolate

class Chocolate {
    var brandname: String = ""
    var type: ChocolateType = .crunchy
}

and a enum ChocolateType with rawValues

enum ChocolateType: String {
    case crunchy = "crunchy"
    case nougat = "nougat"
    case dark = "dark"
    case white = "white"
    case nuts = "nuts"
}

Is there any way, that I can bind a lable or another UIObject to the ChocolateType, so that'll update with the text = label.text?

Favorably I would like to give a ViewController just the chocolate from the ViewModel and let the bindings do the rest.

What changes do I have to make?

chwarr
  • 6,777
  • 1
  • 30
  • 57
Celina
  • 513
  • 4
  • 21

0 Answers0