Skip to content

Commit a17b288

Browse files
committed
Update for Swift 3
1 parent 2264482 commit a17b288

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

Reachability.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@
942942
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
943943
PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.ReachabilitySample;
944944
PRODUCT_NAME = "$(TARGET_NAME)";
945+
SWIFT_VERSION = 3.0;
945946
};
946947
name = Debug;
947948
};
@@ -956,6 +957,7 @@
956957
PRODUCT_BUNDLE_IDENTIFIER = uk.co.joylordsystems.ReachabilitySample;
957958
PRODUCT_NAME = "$(TARGET_NAME)";
958959
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
960+
SWIFT_VERSION = 3.0;
959961
};
960962
name = Release;
961963
};

ReachabilitySample/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
16+
fileprivate func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [AnyHashable: Any]?) -> Bool {
1717
// Override point for customization after application launch.
1818
return true
1919
}

ReachabilitySample/ViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ class ViewController: UIViewController {
2020
super.viewDidLoad()
2121

2222
// Start reachability without a hostname intially
23-
setupReachability(hostName: nil, useClosures: true)
23+
setupReachability(nil, useClosures: true)
2424
startNotifier()
2525

2626
// After 5 seconds, stop and re-start reachability, this time using a hostname
2727
let dispatchTime = DispatchTime.now() + DispatchTimeInterval.seconds(5)
2828
DispatchQueue.main.asyncAfter(deadline: dispatchTime) {
2929
self.stopNotifier()
30-
self.setupReachability(hostName: "google.com", useClosures: true)
30+
self.setupReachability("google.com", useClosures: true)
3131
self.startNotifier()
3232

3333
let dispatchTime = DispatchTime.now() + DispatchTimeInterval.seconds(5)
3434
DispatchQueue.main.asyncAfter(deadline: dispatchTime) {
3535
self.stopNotifier()
36-
self.setupReachability(hostName: "invalidhost", useClosures: true)
36+
self.setupReachability("invalidhost", useClosures: true)
3737
self.startNotifier() }
3838

3939
}
4040
}
4141

42-
func setupReachability(hostName: String?, useClosures: Bool) {
42+
func setupReachability(_ hostName: String?, useClosures: Bool) {
4343
hostNameLabel.text = hostName != nil ? hostName : "No host name"
4444

4545
print("--- set up with host name: \(hostNameLabel.text!)")

ReachabilitySwift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'ReachabilitySwift'
3-
s.version = '2.3.3'
3+
s.version = '3'
44
s.homepage = 'https://github.com/ashleymills/Reachability.swift'
55
s.authors = {
66
'Ashley Mills' => '[email protected]'

0 commit comments

Comments
 (0)