Created
September 17, 2022 12:35
-
-
Save NikolaiRuhe/5051e6f21ee8710cad1d15ff41766e58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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