Browse Source

Change from Reachability()! to try! Reachability()

let reachability = Reachability()! is causing an error in XCode 11.1 and above.  More info here: https://stackoverflow.com/q/58446410/5375263
John 6 years ago
parent
commit
b53ed0b69a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      README.md

+ 2 - 2
README.md

@@ -81,7 +81,7 @@ NOTE: All closures are run on the **main queue**.
 
 ```swift
 //declare this property where it won't go out of scope relative to your listener
-let reachability = Reachability()!
+let reachability = try! Reachability()
 
 reachability.whenReachable = { reachability in
     if reachability.connection == .wifi {
@@ -113,7 +113,7 @@ NOTE: All notifications are delivered on the **main queue**.
 
 ```swift
 //declare this property where it won't go out of scope relative to your listener
-let reachability = Reachability()!
+let reachability = try! Reachability()
 
 //declare this inside of viewWillAppear