NSValue (CMTime :) in fast 3?

I have this code

  var times = [NSValue]()
        for time in timePoints {
            times.append(NSValue(CMTime : time))
        }

I get an error that they are not called anything by CMTime in swift 3. I cannot find any parameter for cm time.

+4
source share
1 answer

Mark the linkNSValue .

init(time: CMTime)

Use NSValue(time: time).


One more. If you want to convert [CMTime]to [NSValue], you can write something like this:

let times = timePoints.map(NSValue.init(time:))
+10
source

Source: https://habr.com/ru/post/1649598/


All Articles