diff --git a/Reachability.xcodeproj/project.pbxproj b/Reachability.xcodeproj/project.pbxproj index 37af7fc9..01667af7 100644 --- a/Reachability.xcodeproj/project.pbxproj +++ b/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; }; diff --git a/ReachabilitySample/AppDelegate.swift b/ReachabilitySample/AppDelegate.swift index 5d20dac4..96acc9ac 100644 --- a/ReachabilitySample/AppDelegate.swift +++ b/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 } diff --git a/ReachabilitySample/ViewController.swift b/ReachabilitySample/ViewController.swift index dd7d6602..8a622946 100644 --- a/ReachabilitySample/ViewController.swift +++ b/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!)") diff --git a/ReachabilitySwift.podspec b/ReachabilitySwift.podspec index e9cb89d1..44ec0843 100644 --- a/ReachabilitySwift.podspec +++ b/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'