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 | |
public final class AsyncMonitorTask: Hashable { | |
let task: Task<Void, Never> | |
init<Element: Sendable>( | |
sequence: sending any AsyncSequence<Element, Never>, | |
performing block: @escaping @MainActor (Element) async -> Void | |
) { | |
self.task = Task { |
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 SwiftUI | |
/// Dynamic SwiftUI view that pins a header above a scroll view's contents, except at larger dynamic type sizes where it makes the header part of the scrolling content. | |
struct DynamicTypePinnedHeaderView<Header: View, Footer: View, Content: View>: View { | |
let inlineThreshold: DynamicTypeSize | |
let header: Header | |
let footer: Footer |
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
Failed to append audio sample buffer CMSampleBuffer 0x1360948c0 retainCount: 3 allocator: 0x1fc343380 | |
invalid = NO | |
dataReady = YES | |
makeDataReadyCallback = 0x0 | |
makeDataReadyRefcon = 0x0 | |
formatDescription = <CMAudioFormatDescription 0x30353c420 [0x1fc343380]> { | |
mediaType:'soun' | |
mediaSubType:'lpcm' | |
mediaSpecific: { | |
ASBD: { |
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 PhotosUI | |
import SwiftUI | |
enum SFSymbol: String { | |
case ant | |
} | |
extension Label where Title == Text, Icon == Image { | |
init(_ titleKey: LocalizedStringKey, systemSymbol: SFSymbol) { | |
self.init(titleKey, systemImage: systemSymbol.rawValue) |
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 PhotosUI | |
import SwiftUI | |
private final class SendableWrapper<T>: @unchecked Sendable { | |
private var unsafeValue: T | |
private let lock = NSLock() | |
var value: T { | |
get { |
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
actor SampleWriter { | |
// ... | |
var isCancelled = false | |
// ... | |
func cancel() async { | |
isCancelled = true | |
} | |
private func encodeAudioTracks() async { |
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 import AVFoundation | |
struct UniqueRef<Value>: ~Copyable, @unchecked Sendable { | |
private let lock = NSLock() | |
private var unsafeValue: Value? | |
init(value: sending Value) { | |
self.unsafeValue = value | |
} |
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
// https://iosdev.space/@andy/112714337582288785 | |
import AuthenticationServices | |
import SwiftUI | |
struct ContentView: View { | |
@State var url = URL(string: "https://example.net")! | |
@Environment(\.webAuthenticationSession) var webAuthenticationSession |
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
// Old way | |
let session = VFAExportSession(asset: asset) | |
session.timeRange = CMTimeRange(start: .seconds(1), duration: .seconds(3)) | |
session.audioMix = audioMix | |
session.audioOutputConfiguration = [ | |
AVFormatIDKey: kAudioFormatMPEG4AAC, | |
AVNumberOfChannelsKey: NSNumber(value: 2), | |
AVSampleRateKey: NSNumber(value: 44_100.0), | |
] | |
session.videoComposition = videoComposition |
NewerOlder