Skip to content

Instantly share code, notes, and snippets.

@trusk89
trusk89 / Closures.playground
Created May 18, 2020
Passing closures between SwiftUI sibling views
View Closures.playground
import Foundation
import SwiftUI
import PlaygroundSupport
typealias OnClickHandler = (() -> Void)
struct ParentView: View {
@State var onClick: OnClickHandler = { }
var body: some View {
You can’t perform that action at this time.