Aryan Kashyap
Aryan Kashyap

Reputation: 1973

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..

Upvotes: 4

Views: 1821

Answers (1)

OOPer
OOPer

Reputation: 47896

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:))

Upvotes: 11

Related Questions