title: How do I convert a CMTime to an NSValue in Swift?
body: <p>I was trying to make use of AVPlayer's <a href="https://developer.apple.com/LIBRARY/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html#//apple_ref/occ/instm/AVPlayer/addBoundaryTimeObserverForTimes:queue:usingBlock:" rel="noreferrer"><code>addBoundaryTimeObserverForTimes</code></a> method from swift and ran into a problem converting <code>CMTimes</code> to <code>NSValues</code>, which is what <code>addBoundaryTimeObserverForTimes</code> take as input. In the end I resorted to wrapping [NSString valueWithCMTime:] in a C function and calling it from swift, but is there a way to do it in pure swift? </p>