Ashley Mills 10 лет назад
Родитель
Сommit
5ee0ac155d
1 измененных файлов с 8 добавлено и 1 удалено
  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