-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
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
found (extension .WrapperView instead of (extension in .WrapperView) for UIViewRepresentable #221
Comments
I had to refactor your code to remove references to Service, ViewModel, and Store objects for which you didn't provide the source. Those objects didn't seem essential for the reproduction of the failure, however, the resulting test succeeds for me, I don't get any error: class CameraControllerTests: XCTestCase {
func testViewLoad_renderAVCaptureVideoPreviewLayer() throws {
var sut = CameraDeviceController.WrapperView()
let exp = sut.on(\.didAppear) { view in
let uiView = try view.view(CameraDeviceController.self).actualView().uiView()
XCTAssertEqual(uiView.tag, 422)
}
ViewHosting.host(view: sut)
wait(for: [exp], timeout: 0.1)
}
}
struct CameraDeviceController: UIViewRepresentable {
func makeUIView(context: Context) -> UIView {
let view = UIView(frame: UIScreen.main.bounds)
view.tag = 422
return view
}
func updateUIView(_ uiView: UIView, context: Context) {}
}
@available(iOS 13.0, macOS 10.15, tvOS 13.0, *)
extension CameraDeviceController {
struct WrapperView: View {
var didAppear: ((Self) -> Void)?
var body: some View {
CameraDeviceController()
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
didAppear?(self)
}
}
}
}
} Could you run this test and see if the error pops up or not? The error message you posted originally here:
I haven't seen this pattern of type prefixes before ( |
Thank you for the fast response. Your code works by me. I added @available but nothing change. Here my setup: Xcode Version 14.2 (14C18) In the worst case, I will give you access to the project. but before I muss bring all over tests to green ;-) |
@nalexn
after switching to the version 0.9.3 from 0.9.2 I get this error
Here my CameraDeviceController which use UIViewRepresentable
The text was updated successfully, but these errors were encountered: