How to conform to a protocol's variables' set & get?
<p>I'm playing around with protocols and how to conform to them.</p>
<pre><code>protocol Human {    
    var height: Int { get set }    
}

struct Boy: Human { 
    var height: Int  { return 5 } // error!
}
</code></pre>
<p>I'm trying to learn different ways that I can implement set and get.
However the code above throws the following error:</p>
<blockquote>
<p>type 'Boy' does not conform to protocol 'Human'</p>
</blockquote>
<p>However writing as below won't have any errors:</p>
<pre><code>struct Boy: Human { 
    var height = 5 // no error
}
</code></pre>
<p>I don't understand the difference nor what exactly needs to be implemented when you can also <em>set</em> a variable. I looked into different questions and tutorials but they all just write and go without any deeper explanation.</p>
<p><strong>EDIT:</strong>
make sure you see Imanou's answer <a href="https://stackoverflow.com/a/38281420/5175709">here</a>. It greatly explains the different scenarios.</p>