We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 424ddbc commit 164673dCopy full SHA for 164673d
Reachability/Reachability.swift
@@ -142,7 +142,7 @@ public class Reachability {
142
public extension Reachability {
143
144
// MARK: - *** Notifier methods ***
145
- func startNotifier() throws {
+ func startNotifier(withImmediateCheck checkImmediately: Bool = false) throws {
146
147
guard let reachabilityRef = reachabilityRef, !notifierRunning else { return }
148
@@ -159,8 +159,10 @@ public extension Reachability {
159
}
160
161
// Perform an intial check
162
- reachabilitySerialQueue.async {
163
- self.reachabilityChanged()
+ if checkImmediately {
+ reachabilitySerialQueue.async {
164
+ self.reachabilityChanged()
165
+ }
166
167
168
notifierRunning = true
0 commit comments