Key value observing exposureDuration
<p>I'm building a camera app, and I'm trying to expose the current exposure duration to the user. Since this value constantly changes until manually set, I need to use kvo to stream the values to the user. I've successfully done this with the <code>ISO</code>, and can observe changes to the <code>exposureDuration</code>, but cannot coerce the new value to a <code>CMTime</code> object (which is what exposureDuration is). Below is the code I'm using to try and accomplish this:</p>

<pre><code>override init() {
  super.init()

  captureDevice = self.selectCamera()

  captureDevice?.addObserver(self, forKeyPath: "ISO", options: .New, context: &amp;isoContext)
  captureDevice?.addObserver(self, forKeyPath: "exposureDuration", options: .New, context: &amp;shutterContext)
}

deinit {
  captureDevice?.removeObserver(self, forKeyPath: "ISO")
  captureDevice?.removeObserver(self, forKeyPath: "exposureDuration")
}

override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer&lt;Void&gt;) {
  let newValue = change?[NSKeyValueChangeNewKey]

  if context == &amp;isoContext {
    store.iso.value = newValue as! Float
  } else if context == &amp;shutterContext {
    // The app crashes at this line.
    // Thread 1: EXC_BREAKPOINT (code=1, subcode=0x100091670)
    // newValue is "AnyObject" in the debug area
    store.shutterSpeed.value = newValue as! CMTime
  }
}
</code></pre>

<p>Am I doing something wrong, or is this a legitimate bug that I need to file with apple?</p>