Post

Replies

Boosts

Views

Activity

Reply to How to get network status in apple watch??
Thank you for coment.I folow same page for developing the code.And you can check by below:monitor.pathUpdateHandler = { path in if path.status == .satisfied { print("We're connected!") self.lbl_Network_status.setText("Connected".localized) self.image_Network.setImage(UIImage(named: "ic_network")) if path.usesInterfaceType(.wifi) { print("It's WiFi!") } else if path.usesInterfaceType(.cellular) { print("3G/4G FTW!!!") } else if path.usesInterfaceType(.wiredEthernet) { print("wiredEthernet") }else if path.usesInterfaceType(.loopback) { print("loopback") }else if path.usesInterfaceType(.other) { print("other") } } else { print("No connection.") self.lbl_Network_status.setText("Not Connected".localized) self.image_Network.setImage(UIImage(named: "ic_network_not")) } // print(path.isExpensive) // Only ipv4 Connection is support .Connection dns and ipv6 not support } let queue = DispatchQueue(label: "InternetConnectionMonitor") // let queue = DispatchQueue.global(qos: .background) monitor.start(queue: queue)
Apr ’20