2014-10-17 57 views

回答

5

對應valueWithCMTime:雨燕構造是NSValue(CMTime:)

import CoreMedia 
import AVFoundation 

let cmTime = CMTimeMake(10, 20) 
let cmValue = NSValue(CMTime: cmTime) 
+2

問題是我是不是進口CoreMedia。出於某種原因,我認爲NSValue的CMTime構造函數是在AVFoundation中定義的。謝謝! – 2014-10-17 17:52:43

+2

對於swift 3看看這裏:http://stackoverflow.com/questions/38669061/nsvaluecmtime-in-swift-3 – 2016-10-22 12:12:44