Skip to content

Instantly share code, notes, and snippets.

View duemunk's full-sized avatar

Tobias Due Munk duemunk

View GitHub Profile
import SwiftUI
// Animates nicely since the type of both returns are the same, i.e. AnyView<Text>
func gimme(toggle: Bool) -> AnyView {
if toggle {
return AnyView(
Text("Hello World")
)
} else {
return AnyView(
import SwiftUI
struct Cursor: Equatable {
let ns: NSCursor?
let id: String
}
struct CursorPreference: PreferenceKey {