Skip to content

scottiesan/ReachabilityCombine

Repository files navigation

ReachabilityCombine

Add publisher to Reachability for convenience.

usage:

   try? Reachability().connectionPublisher()
        .sink(receiveCompletion: {
            print($0)
        }, receiveValue: {
            print($0)
            self.connectionLbl.text = $0.description
        })
        .store(in: &subscriptions!)


// for specific connection 
 try? Reachability().connectionPublisher(for: .wifi)
        .sink(receiveCompletion: {
            print($0)
        }, receiveValue: {
            print($0)
            self.connectionLbl.text = $0.description
        })
        .store(in: &subscriptions!)

About

Add publisher to reachability

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages