ISIS3510-202410-Team11 / Swift

0 stars 0 forks source link

added connectivity app manager and validations on each button of profile view #48

Closed Pabluchenkoo closed 6 months ago

Pabluchenkoo commented 6 months ago

Take a look to the issue teammates. Long story short I've implemented a manager for connectivity. So its up on the background. You can use it on your respective view like so: @ObservedObject private var connectivityManager = ConnectivityManager.shared

As it is an observed object it stores the state and then you can make validations on buttons or whatever you need like so:

if connectivityManager.isConnected {
                        showConfirmationDialog = true
                    } else {
                        alertMessage = "No internet connection available. Please connect to the internet to continue."
                        showAlert = true
                    }

Also in this commit whenever the user losses connection a red banner is displayed on the top of the screen.

Pabluchenkoo commented 6 months ago

@CristianCaro915 @JuanSe2003 let me know what you think about it mates

CristianCaro915 commented 6 months ago

I had a network manager too but the way you managed alerts is better. I had to create alerts in each view with the same generic message. Your way is more efficient my partner

Pabluchenkoo commented 6 months ago

great boys