Эх сурвалжийг харах

error handling

the example code did not compile without adding a try and do/catch
abunur 10 жил өмнө
parent
commit
9ade4cbbb7
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  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