Skip to content

Instantly share code, notes, and snippets.

View cdf1982's full-sized avatar
🐺
Exploring

cdf1982 cdf1982

🐺
Exploring
View GitHub Profile
@cdf1982
cdf1982 / CustomSwiftUIAlert.swift
Created April 24, 2024 08:33
Hopefully a more convenient method to present Alerts in SwiftUI at runtime
//
// CustomSwiftUIAlert.swift
// Field
//
// Created by Cesare Forelli on 24/04/24.
//
import SwiftUI
@cdf1982
cdf1982 / AVSpeechSynthGlue.swift
Created June 19, 2024 15:07 — forked from GottaGetSwifty/AVSpeechSynthGlue.swift
Fun example for abstracting delegate into a Type with a closure
import SwiftUI
import AVFoundation
class AVSpeechSynthGlue: NSObject, AVSpeechSynthesizerDelegate {
enum State {
case didStart(AVSpeechUtterance)
case willSpeakRangeOfSpeechString(NSRange)
case willSpeak(AVSpeechSynthesisMarker)
case didPause(AVSpeechUtterance)
case didContinue(AVSpeechUtterance)