CMTimeMakeWithSeconds explained

CMTime is structure which has two main components, timeScale and value.


CMTIME = VALUE  / TIMESCALE

where, TimeScale =  fraction of a second each unit in numerator occupies.

CMTIME = Value / TimeScale

1) public func CMTimeMake(_ value: Int64_ timescale: Int32) -> CMTime

CMTimeMake(600010)

Means, there are 6000 units , each unit occupies 1/10 of a second


2) public func CMTimeMakeWithSeconds(_ seconds: Float64_ preferredTimescale: Int32) -> CMTime

CMTimeMakeWithSeconds(10.0,500)

10.0 = VALUE /500

Therefore VALUE = 5000

So, there are 5000 units, each occupy 1/500 of a second


Comments

Popular posts from this blog

hitTest on iOS to identify the view being hit

How to set Custom Section Header in UITableView for ios sdk version greater than 6