Open mxnmike opened 2 years ago
This is my code, if I run it on iOS 15, it runs incredible..... but when I run it on iOS 14.8.2 the Scanner view won't get dismissed, it does execute the handleScan Method, because if I dismiss the view manually, I see for a moment the expected url.
Any ideas why is not working just on iOS 14?
Thanks.
`struct BottomNavigationItem: View {
@State private var isShowingScanner = false let webViewModel: WebViewModel private let logoutUrlString = "some url" private let qrCodeUrlString = "another url" private let homeUrlString = "home url" var body: some View { return Text("") .toolbar { ToolbarItemGroup(placement: .bottomBar) { Spacer() Button(action: homeButtonPressed) { VStack { Image("home_icon") Text("Home") .foregroundColor(.black) .font(.system(size: 10)) } } Spacer() Button(action: qrReaderButtonPressed) { VStack{ Image("camera_icon") Text("Read QR") .foregroundColor(.black) .font(.system(size: 10)) }.sheet(isPresented: $isShowingScanner) { CodeScannerView(codeTypes: [.qr], simulatedData: "16", completion: self.handleScan) .edgesIgnoringSafeArea(.vertical) } } Spacer() Button(action: logoutButtonPressed) { VStack{ Image("power_icon") Text("Logout") .foregroundColor(.black) .font(.system(size: 10)) } } Spacer() } } } func homeButtonPressed() { webViewModel.urlString = homeUrlString webViewModel.loadUrl() } func qrReaderButtonPressed() { isShowingScanner = true } func logoutButtonPressed() { webViewModel.hiddenBottomView = true webViewModel.urlString = logoutUrlString webViewModel.loadUrl() } func handleScan(result: Result<ScanResult, ScanError>) { self.isShowingScanner = false switch result { case .success(let code): let details = code.string guard details != "" else { return } webViewModel.urlString = qrCodeUrlString + details webViewModel.loadUrl() case .failure(let error): print("Scanning Failed:\(error)") } }
}`
I'm going to take a look and try your code to see what is wrong with it
This is my code, if I run it on iOS 15, it runs incredible..... but when I run it on iOS 14.8.2 the Scanner view won't get dismissed, it does execute the handleScan Method, because if I dismiss the view manually, I see for a moment the expected url.
Any ideas why is not working just on iOS 14?
Thanks.
`struct BottomNavigationItem: View {
}`