Skip to content

Instantly share code, notes, and snippets.

@NikolaiRuhe
Created September 17, 2022 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NikolaiRuhe/5051e6f21ee8710cad1d15ff41766e58 to your computer and use it in GitHub Desktop.
Save NikolaiRuhe/5051e6f21ee8710cad1d15ff41766e58 to your computer and use it in GitHub Desktop.
import XCTest
import SwiftUI
final class CaptureListTests: XCTestCase {
func testCaptureList() throws {
withBound("foo") { $boundValue in
print("value: \(boundValue), binding type: \(type(of: $boundValue))")
}
}
}
func withBound<T>(_ value: T, call closure: (Binding<T>) -> Void) {
let binding = Binding(get: { value }, set: { _ in })
closure(binding)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment