My app stopped to work after update to 16.5 In my second iPhone where I didn’t update the app work fine and on emulators too, the old versions are the 16.3.1. In my app I use firebase authentication, cloud messaging, realtime database. The login work fine, when I choose the city the user is correctly subscribed on the topic for manage the firebase cloud messaging but THE VIEW DON’T CHANGE after the click on the list of the cities managed by .ontapgesture where I set the value true of movetonextview and then I have the control of the view with an “if movenextview is true {set the scrollview with the buttons}”. I had verify that the movenextview and the city is setted correctly, when I relog, the app switched automatically the view correctly as it should do. Now when I tap on the button “change city” it should change the view but it doesn’t again. I checked toughly the code and I can’t find an error. The app doesn’t work ONLY on the device 16.5-16.6 when I put the app on the device 16.3.1 it works and it works on the emulator of Xcode too where the version is 16.1. Of course the debug don’t give me result when I tap the button.
Thanks for the attention.
Here piece of code that I used..
import SwiftUI
class ViewModel: ObservableObject {
@Published var willMoveToNextScreen:Bool = false
}
struct ContentView: View {
@StateObject var viewModel = ViewModel()
@State var first5comuni:[String] = ["Roma", "Verona", "Milano"]
var body: some View
{
if viewModel.willMoveToNextScreen == true {
ScrollView {
Button ("LocalizedStringKey", action: {
viewModel.willMoveToNextScreen = false
})
}
}
else if viewModel.willMoveToNextScreen == false {
ScrollView {
ForEach(first5comuni, id: \.self) { index in
Text(index)
.opacity(0.5)
.frame(width: .infinity, height: 35, alignment: .center)
.onTapGesture {
viewModel.willMoveToNextScreen = true
}
}
}
}
}
}
I tried to upgrade the second iphone and the app stopped to work. I think is the new upgrade problem.