Skip to content

Instantly share code, notes, and snippets.

View AnthonyMDev's full-sized avatar

Anthony Miller AnthonyMDev

  • Apollo GraphQL
  • Las Vegas, NV
  • 22:19 (UTC -07:00)
  • X @AnthonyMDev
View GitHub Profile
class ConcurrentTaskContainer {
private let actor = Actor()
private actor Actor {
private var tasks = [UUID: Task<Void, Error>]()
private var waitForAllTaskContinuations = [CheckedContinuation<Void, Never>]()
deinit {
for task in tasks.values {
task.cancel()
@AnthonyMDev
AnthonyMDev / gist:08101004927a0e132f47875e36199121
Created October 20, 2021 21:07
String Interpolation Auto-Nesting Indentation
import Foundation
public extension DefaultStringInterpolation {
/// A String interpolation function that respects nested indentation.
///
/// Example:
/// ```swift
/// class Root {
/// let children: [Root] = []