How can I add 5 seconds to my current playing Time?
Actually this is my code:
CMTime currentTime = music.currentTime;
I can´t use CMTimeGet
Swift 4, using custom operator:
extension CMTime {
static func + (lhs: CMTime, rhs: TimeInterval) -> CMTime {
return CMTime(seconds: lhs.seconds + rhs,
preferredTimescale: lhs.timescale)
}
static func += (lhs: inout CMTime, rhs: TimeInterval) {
lhs = CMTime(seconds: lhs.seconds + rhs,
preferredTimescale: lhs.timescale)
}
}