Mini-exercise
In the lightbulb example, the bulb goes back to a successful setting if the current gets too high. In real life, that wouldn’t work. The bulb would burn out! Rewrite the structure so that the bulb turns off before the current burns it out. You’ll need to use the willSet observer for this. This observer gets called before the value is changed. The value that is about to be set is available in the constant newValue.
Keep in mind that you cannot change this newValue, and it will still be set, so you’ll have to do more than just add a willSet observer. :]