Set UserDefaults as a bool value : <p>I want to set my "Upgrade" Buttons in my app with UserDefaults so whenever the app opens, it knows which button to show. </p>

<p>Right now, my code is </p>

<pre><code>defaults.set(buttontwo.isHidden, forKey: "isHidden")
       buttontwo.isHidden = UserDefaults.bool(forKey: "isHidden")
</code></pre>

<p>however, when I run it, it says 'Instance member "bool" cannot be used on type "UserDefaults", did you mean to use a value of this type instead?"</p>

<p>In my game, whenever you hit the upgrade button, that one dissapears, and the next one appears. How can i fix this error?</p>
