title: Swift Protocols: Difference between { get } and { get set } with concrete examples?
body: <p>I'm pretty new to Swift, and although I've read Apple's documentation and many topics and threads about this, I still can't understand what's the difference between <code>{ get }</code> and <code>{ get set }</code>. I mean, I'm looking for an explanation with a concrete example.</p>
  
  <p>Like, for example:</p>
  
  <pre><code>protocol PersonProtocol {
      var firstName: String { get }
      var lastName: String { get set }
  }
  </code></pre>
  
  <p>What would be the actual difference between these two properties? I tried to play with these properties in a playground:</p>
  
  <pre><code>struct Person: PersonProtocol {
      var firstName: String
      var lastName: String
  }
  
  var p = Person(firstName: "John", lastName: "Lennon")
  print(p.firstName) // John
  print(p.lastName) // Lennon
  p.firstName = "Paul"
  p.lastName = "McCartney"
  print(p.firstName) // Paul
  print(p.lastName) // McCartney
  </code></pre>
  
  <p>Did not help... Thanks for your help.</p>