Ver Fonte

Update README.md

Ashley Mills há 10 anos atrás
pai
commit
5ee0ac155d
1 ficheiros alterados com 8 adições e 1 exclusões
  1. 8 1
      README.md

+ 8 - 1
README.md

@@ -32,7 +32,14 @@ Just drop the **Reachability.swift** file into your project. That's it!
 ## Example - closures
 
 ````
-    let reachability = try? Reachability.reachabilityForInternetConnection()!
+    let reachability: Reachability?
+    do {
+        reachability = try Reachability.reachabilityForInternetConnection()
+    } catch {
+        print("Unable to create Reachability")
+        return
+    }
+
 
     reachability?.whenReachable = { reachability in
         // this is called on a background thread, but UI updates must