Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Struct Extension
import AVFoundation
public typealias AOIBaseType = AOIBaseProtocol
public protocol AOIBaseProtocol {
associatedtype T
var aoi: T { get }
static var aoi: T.Type { get }
}
extension TimeProxy {
public static var zero: CMTime {
return kCMTimeZero
}
public var seconds: Double {
return CMTimeGetSeconds(base)
}
}
public struct TimeProxy {
fileprivate let base: CMTime
init(_ base: CMTime) {
self.base = base
}
}
extension CMTime: AOIBaseType {
public typealias T = TimeProxy
public var aoi: T {
return T(self)
}
public static var aoi: T.Type {
return T.self
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.