I am working on a SwiftUI application. I am using a list which displays the response from the server. Once the user clicks on the list item, it opens up a new view which loads another data from the server on some textviews and buttons. However, when the data fully loads, the back button disables. Please refer to the attached video. [https://1drv.ms/v/s!Au1n19s_ZcghxgssOZFa_6vcUxBO?e=9xZUGh]
I had a view that used to be opened from a list. The view contained a scrollview and all the items are listed in it including the TextFields, Texts, Button, Picker and others. I was using a custom modifier in the toolbar trialing items to show a notification Sheet and a logout button.
Below is the custom code:
ScrollView{
// some code
}.toolbar(){
ToolbarItem(placement: .navigationBarTrailing){
Logout().environmentObject(settings)
}
}
The logout class held the messaging sheet and the logout button. This caused the back button to be disappearing whenever the view loaded. I have now changed it to:
ScrollView{
//some code
}
.navigationBarItems(trailing: Logout().environmentObject(settings))