Skip to content

Instantly share code, notes, and snippets.

@WFT
WFT / metadata.swift
Last active November 6, 2024 20:17
Modify CAF audio file metadata with Core Audio / AudioToolbox
import AudioToolbox
import Foundation
func check(_ status: OSStatus, line: Int = #line) {
if status != noErr {
fatalError("Error on line \(line): OSStatus \(status) - https://osstatus.com/search/results?search=\(status)")
}
}
@WFT
WFT / nonisolated-init.swift
Created February 12, 2026 22:41
Nonisolated Init
import Dispatch
let someDispatchQueue = DispatchQueue()
@MainActor
class Foo {
nonisolated static let shared = Foo()
var mybar: Bar // I only need to get this from the main actor
// In the real code there are many properties; that's why I'm not tagging