title: Override property in Swift subclass
body: <p>Can anyone explain the behaviour when subclassing properties? I am sure there is a good explanation for why 'override' does not actually override the property.</p>
  
  <p>Why does Swift allow the <code>surname</code> property to be overridden but apparently still uses the super class's property and associated functions? They are not overridden.</p>
  
  <p>It would seem that I would have to define some function that gets called in the <code>didSet()</code> method and override that to ensure the subclass does not inherit the super class's function as with the <code>telephone</code> property.</p>
  
  <p>Is there any way to override a property's <code>didSet()</code> method? Creating some function that gets called seems to add an unnecessary extra complexity?</p>
  
  <p>What is the correct way of achieving this?</p>
  
  <pre><code>import Cocoa
  
  class BaseClass {
      var _name: String?
      var name: String? {
          get {
              return _name
          }
          set {
              _name = newValue
              print("BaseClass \(name)")
          }
      }
  
      var surname: String? {
          didSet {
              print("BaseClass \(surname)")
          }
      }
  
      var telephone: String? {
          didSet {
              telephoneSet()
          }
      }
  
      func telephoneSet(){
          print("BaseClass \(telephone)")
      }
  }
  
  class SubClass: BaseClass {
      override var name: String? {
          get {
              return _name
          }
          set {
              _name = newValue
              print("SubClass \(name)")
          }
      }
      override var surname: String? {
          didSet {
              print("SubClass \(surname)")
          }
      }
  
      override func telephoneSet(){
          print("SubClass \(telephone)")
      }
  }
  
  
  let object = SubClass()
  
  object.name = "Jenny"
  object.surname = "Jones"
  object.telephone = "10810"
  </code></pre>
  
  <p>Generates the following output:</p>
  
  <pre><code>SubClass Optional("Jenny")
  BaseClass Optional("Jones")
  SubClass Optional("Jones")
  SubClass Optional("10810")
  </code></pre>