Przeglądaj źródła

error handling

the example code did not compile without adding a try and do/catch
abunur 10 lat temu
rodzic
commit
9ade4cbbb7
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      README.md

+ 5 - 1
README.md

@@ -119,7 +119,11 @@ NSNotificationCenter.defaultCenter().addObserver(self,
                                                  name: ReachabilityChangedNotification,
                                                  object: reachability)
 
-reachability.startNotifier()
+do{
+      try reachability.startNotifier()
+    }catch{
+      print("could not start reachability notifier")
+    }
 ```
 
 and