We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
callOnTapGesture() does not work when the view is presented with host() async. Tested with Xcode 16.0 with Swift 6.0 mode.
callOnTapGesture()
host() async
struct TapGestureView: View { @State var flag = false let inspection = Inspection<Self>() var body: some View { Text("flag = \(flag)") .onTapGesture { self.flag.toggle() } .onReceive(inspection.notice) { self.inspection.visit(self, $0) } } } final class TapGestureViewTests: XCTestCase { @MainActor func test_regular_host() throws { let sut = TapGestureView() let exp = sut.inspection.inspect { view in XCTAssertEqual(try view.anyView().text().string(), "flag = false") try view.anyView().text().callOnTapGesture() XCTAssertEqual(try view.anyView().text().string(), "flag = true") // 🆗 } ViewHosting.host(view: sut) wait(for: [exp], timeout: 1) } @MainActor func test_async_host() async throws { let sut = TapGestureView() try await ViewHosting.host(sut) { let view = try $0.inspect() XCTAssertEqual(try view.anyView().text().string(), "flag = false") try view.anyView().text().callOnTapGesture() XCTAssertEqual(try view.anyView().text().string(), "flag = true") // 💥 } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
callOnTapGesture()
does not work when the view is presented withhost() async
.Tested with Xcode 16.0 with Swift 6.0 mode.
The text was updated successfully, but these errors were encountered: