title: What does @objc dynamic var mean in Swift 4
body: <p>Could you briefly explain what <code>@objc</code> and <code>dynamic</code> mean in Swift 4 using Xcode 9.x?</p>
  
  <p>With tries and errors and following articles in the stackoverflow, I have eventually achieved this snippet to work. But I would like to know a little bit about those magical keywords.</p>
  
  <p><a href="https://i.stack.imgur.com/Oe8jY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Oe8jY.png" alt="enter image description here"></a></p>
  
  <pre><code>class SampleViewController: NSViewController {
  
    @objc class Parameters : NSObject {
      @objc dynamic var value1: Double = 0  // bound to Value of a NSTextfield with NumberFormatter
      @objc dynamic var value2: Double = 0  // as "parameters.value1" for the Model Key Path
    }
  
    @objc dynamic var parameters = Parameters()
  
    @objc dynamic var value3: Double {  // in the similar way as "value3" for the Model Key Path
      get {
        return parameters.value1 + parameters.value2
      }
    }
  
    override class func keyPathsForValuesAffectingValue(forKey key: String) -&gt; Set&lt;String&gt; {
      switch key {
      case "value3" :
        return Set(["parameters.value1", "parameters.value2"])
      default:
        return super.keyPathsForValuesAffectingValue(forKey: key)
      }
    }
  
  }
  </code></pre>