Просмотр исходного кода

Merge branch 'master' into develop

Ashley Mills 10 лет назад
Родитель
Сommit
7413178d23
2 измененных файлов с 20 добавлено и 3 удалено
  1. 18 1
      README.md
  2. 2 2
      Reachability.swift

+ 18 - 1
README.md

@@ -8,8 +8,25 @@ Inspired by https://github.com/tonymillion/Reachability
 
 
 - If an application has the privacy option “Use cellular data” turned off, the Reachability class still reports isReachable() to be true. There is currently no (non-private) API to detect this. If you need this feature, please raise file a [bug report](https://bugreport.apple.com) with Apple to get this fixed. See devforums thread for details: https://devforums.apple.com/message/1059332#1059332
 - If an application has the privacy option “Use cellular data” turned off, the Reachability class still reports isReachable() to be true. There is currently no (non-private) API to detect this. If you need this feature, please raise file a [bug report](https://bugreport.apple.com) with Apple to get this fixed. See devforums thread for details: https://devforums.apple.com/message/1059332#1059332
 
 
-## Use
+## Installation
+### CocoaPods
+[CocoaPods][] is a dependency manager for Cocoa projects. To install Reachability.swift with CocoaPods:
 
 
+ 1. Make sure CocoaPods is [installed][CocoaPods Installation].
+
+ 2. Update your Podfile to include the following:
+
+    ``` ruby
+    use_frameworks!
+    pod 'ReachabilitySwift', git: 'https://github.com/ashleymills/Reachability.swift'
+    ```
+
+ 3. Run `pod install`.
+
+[CocoaPods]: https://cocoapods.org
+[CocoaPods Installation]: https://guides.cocoapods.org/using/getting-started.html#getting-started
+
+### Manual
 Just drop the **Reachability.swift** file into your project. That's it!
 Just drop the **Reachability.swift** file into your project. That's it!
 
 
 ## Example - closures
 ## Example - closures

+ 2 - 2
Reachability.swift

@@ -42,7 +42,7 @@ func callback(reachability:SCNetworkReachability, flags: SCNetworkReachabilityFl
 public class Reachability: NSObject {
 public class Reachability: NSObject {
 
 
     public typealias NetworkReachable = (Reachability) -> ()
     public typealias NetworkReachable = (Reachability) -> ()
-    public typealias NetworkUneachable = (Reachability) -> ()
+    public typealias NetworkUnreachable = (Reachability) -> ()
 
 
     public enum NetworkStatus: CustomStringConvertible {
     public enum NetworkStatus: CustomStringConvertible {
 
 
@@ -63,7 +63,7 @@ public class Reachability: NSObject {
     // MARK: - *** Public properties ***
     // MARK: - *** Public properties ***
 
 
     public var whenReachable: NetworkReachable?
     public var whenReachable: NetworkReachable?
-    public var whenUnreachable: NetworkUneachable?
+    public var whenUnreachable: NetworkUnreachable?
     public var reachableOnWWAN: Bool
     public var reachableOnWWAN: Bool
     public var notificationCenter = NSNotificationCenter.defaultCenter()
     public var notificationCenter = NSNotificationCenter.defaultCenter()