Skip to content

Instantly share code, notes, and snippets.

infix operator ?! { }
func ?!<A>(v: A?, msg: String) -> A {
if let v = v {
return v
} else {
println(msg)
exit(1)
}
}
@mchakravarty
mchakravarty / CountingEditorApp.swift
Created September 9, 2020 13:50
SwiftUI AttributeGraph cycle in playground only
// Put this into an Xcode 12.0 multiplatform app
import SwiftUI
struct ContentView: View {
@State var text = "Hello!"
var body: some View {
VStack {
TextEditor(text: $text)