NSValue(CMTime: ) in swift 3?

旧时模样 提交于 2019-12-23 12:25:22

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/38669061/nsvaluecmtime-in-swift-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!