Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Config/DeviceConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import SystemConfiguration
class DeviceManager {
static let shared: DeviceManager = DeviceManager()

var networkStatue: Bool {
/// Current network reachability status
var networkStatus: Bool {
return checkDeviceNetworkStatus()
}

private init() {}

private func checkDeviceNetworkStatus() -> Bool {
print("Check to Device Natwork Status....")
print("Check Device Network Status....")
var zeroAddress = sockaddr_in(sin_len: 0, sin_family: 0, sin_port: 0, sin_addr: in_addr(s_addr: 0), sin_zero: (0, 0, 0, 0, 0, 0, 0, 0))
zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress))
zeroAddress.sin_family = sa_family_t(AF_INET)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SplashViewController: UIViewController {
}

func checkDeviceNetworkStatus() {
if !(DeviceManager.shared.networkStatue) {
if !(DeviceManager.shared.networkStatus) {
DispatchQueue.main.async {
let networkAlert = NetworkAlert(action: {
self.checkDeviceNetworkStatus()
Expand Down