From c92a138130a29e561b057a2bc0aca0cba60ae031 Mon Sep 17 00:00:00 2001 From: mamadnazar Date: Wed, 12 Mar 2025 01:52:21 +0500 Subject: [PATCH] [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 --- .../Auth/Screens/WelcomeViewController.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/iphone/Maps/Tourism/Presentation/Auth/Screens/WelcomeViewController.swift b/iphone/Maps/Tourism/Presentation/Auth/Screens/WelcomeViewController.swift index 0cd2b8579f..2e08259e60 100644 --- a/iphone/Maps/Tourism/Presentation/Auth/Screens/WelcomeViewController.swift +++ b/iphone/Maps/Tourism/Presentation/Auth/Screens/WelcomeViewController.swift @@ -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) + } + }