[ios] added internet connection check on welcome screen since ios asks for enabling wifi and/or cellular after first request, and if it is login we get error so added an internet connection check before login or registration requests

This commit is contained in:
mamadnazar 2025-03-12 01:52:21 +05:00
parent f9a6bc5c00
commit c92a138130

View file

@ -83,6 +83,7 @@ class WelcomeViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
isInternetAvailable()
}
// MARK: - Setup
@ -161,4 +162,16 @@ class WelcomeViewController: UIViewController {
@objc private func signUpClicked() {
performSegue(withIdentifier: "Welcome2SignUp", sender: nil)
}
private func isInternetAvailable() {
let monitor = NWPathMonitor()
let queue = DispatchQueue.global(qos: .background)
monitor.pathUpdateHandler = { path in
monitor.cancel() // Stop monitoring after checking
}
monitor.start(queue: queue)
}
}