title: Swift correct use of getters and setters
body: <p>Can someone please help me understand the correct use of getters and setters in swift. I get the impression its not the same as say Java.</p>
  
  <p>Is this the correct usage in Swift to store and access a class variable?</p>
  
  <pre><code>class Person {
      private var name: String
  
      init(name: String) {
          self.name = name
      }
  
      func setName(name: String) {
          self.name = name
      }
  
      func getName() -&gt; String {
          return name
      }
  }
  </code></pre>