Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSValue(CMTime: ) in swift 3?

i have this code

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

i get an error that their is nothing called CMTime in swift 3 i can't really find any param for cm time..

like image 613
Aryan Kashyap Avatar asked Dec 19 '22 14:12

Aryan Kashyap


1 Answers

Check the reference of NSValue.

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:))
like image 100
OOPer Avatar answered Dec 21 '22 03:12

OOPer