This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import Combine | |
| extension AnyCancellable: @retroactive @unchecked Sendable {} | |
| extension CurrentValueSubject: @retroactive @unchecked Sendable {} | |
| public extension Publisher where Failure == Never, Output: Sendable { | |
| var stream: AsyncStream<Output> { | |
| AsyncStream { continuation in | |
| let cancellable = self.sink { completion in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import AVFoundation | |
| public extension AVPlayer { | |
| func periodicTimeValues( | |
| forInterval interval: CMTime, | |
| queue: dispatch_queue_t? = nil | |
| ) -> AsyncStream<TimeInterval> { | |
| let (stream, continuation) = AsyncStream.makeStream(of: Double.self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public extension FormatStyle where Self == TimeFormatStyle<FloatingPointFormatStyle<Double>> { | |
| static var time: TimeFormatStyle<FloatingPointFormatStyle<Double>> { | |
| TimeFormatStyle(baseStyle: .number, countDirection: nil, formatter: .timeFormatter) | |
| } | |
| static func time(formatter: DateComponentsFormatter) -> TimeFormatStyle<FloatingPointFormatStyle<Double>> { | |
| TimeFormatStyle(baseStyle: .number, countDirection: nil, formatter: formatter) | |
| } | |