Skip to content

Instantly share code, notes, and snippets.

View awaismubeen's full-sized avatar
🎯
Focusing

Awais Mubeen awaismubeen

🎯
Focusing
View GitHub Profile
@awaismubeen
awaismubeen / ReachabilityManager.swift
Created October 3, 2024 12:56
This class is used to check the connectivity a MAC OSX project
extension Notification.Name{
static let internetIsBack = Notification.Name(rawValue: "internetIsBack")
}
class ReachabilityManager:NSObject {
private var monitor: NWPathMonitor?
private var queue = DispatchQueue.global(qos: .background)
private var isConnected: Bool = false // To store the current network status
static let shared:ReachabilityManager = ReachabilityManager()// Singleton instance for global access