Răsfoiți Sursa

Merge branch 'develop'

Ashley Mills 9 ani în urmă
părinte
comite
330a52b5c5

+ 2 - 0
Reachability.xcodeproj/project.pbxproj

@@ -942,6 +942,7 @@
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.ReachabilitySample;
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_VERSION = 3.0;
 			};
 			name = Debug;
 		};
@@ -956,6 +957,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.ReachabilitySample;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+				SWIFT_VERSION = 3.0;
 			};
 			name = Release;
 		};

+ 1 - 1
ReachabilitySample/AppDelegate.swift

@@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 
     var window: UIWindow?
 
-    private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
+    fileprivate func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [AnyHashable: Any]?) -> Bool {
         // Override point for customization after application launch.
         return true
     }

+ 4 - 4
ReachabilitySample/ViewController.swift

@@ -20,26 +20,26 @@ class ViewController: UIViewController {
         super.viewDidLoad()
 
         // Start reachability without a hostname intially
-        setupReachability(hostName: nil, useClosures: true)
+        setupReachability(nil, useClosures: true)
         startNotifier()
 
         // After 5 seconds, stop and re-start reachability, this time using a hostname
         let dispatchTime = DispatchTime.now() + DispatchTimeInterval.seconds(5)
         DispatchQueue.main.asyncAfter(deadline: dispatchTime) {
             self.stopNotifier()
-            self.setupReachability(hostName: "google.com", useClosures: true)
+            self.setupReachability("google.com", useClosures: true)
             self.startNotifier()
 
             let dispatchTime = DispatchTime.now() + DispatchTimeInterval.seconds(5)
             DispatchQueue.main.asyncAfter(deadline: dispatchTime) {
                 self.stopNotifier()
-                self.setupReachability(hostName: "invalidhost", useClosures: true)
+                self.setupReachability("invalidhost", useClosures: true)
                 self.startNotifier()            }
 
         }
     }
     
-    func setupReachability(hostName: String?, useClosures: Bool) {
+    func setupReachability(_ hostName: String?, useClosures: Bool) {
         hostNameLabel.text = hostName != nil ? hostName : "No host name"
         
         print("--- set up with host name: \(hostNameLabel.text!)")

+ 1 - 1
ReachabilitySwift.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
   s.name         = 'ReachabilitySwift'
-  s.version      = '2.3.3'
+  s.version      = '3'
   s.homepage     = 'https://github.com/ashleymills/Reachability.swift'
   s.authors      = {
     'Ashley Mills' => 'ashleymills@mac.com'