Skip to content

Commit fe7834b

Browse files
committed
Revert "Rename class Reachability -> ReachabilityKit to avoid bug swiftlang/swift#56573"
This reverts commit 2edd7db.
1 parent 2edd7db commit fe7834b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Sources/Reachability.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ public extension Notification.Name {
4343
static let reachabilityChanged = Notification.Name("reachabilityChanged")
4444
}
4545

46-
public class ReachabilityKit {
46+
public class Reachability {
4747

48-
public typealias NetworkReachable = (ReachabilityKit) -> ()
49-
public typealias NetworkUnreachable = (ReachabilityKit) -> ()
48+
public typealias NetworkReachable = (Reachability) -> ()
49+
public typealias NetworkUnreachable = (Reachability) -> ()
5050

5151
@available(*, unavailable, renamed: "Connection")
5252
public enum NetworkStatus: CustomStringConvertible {
@@ -166,7 +166,7 @@ public class ReachabilityKit {
166166
}
167167
}
168168

169-
public extension ReachabilityKit {
169+
public extension Reachability {
170170

171171
// MARK: - *** Notifier methods ***
172172
func startNotifier() throws {
@@ -252,7 +252,7 @@ public extension ReachabilityKit {
252252
}
253253
}
254254

255-
fileprivate extension ReachabilityKit {
255+
fileprivate extension Reachability {
256256

257257
func setReachabilityFlags() throws {
258258
try reachabilitySerialQueue.sync { [unowned self] in
@@ -281,7 +281,7 @@ fileprivate extension ReachabilityKit {
281281

282282
extension SCNetworkReachabilityFlags {
283283

284-
typealias Connection = ReachabilityKit.Connection
284+
typealias Connection = Reachability.Connection
285285

286286
var connection: Connection {
287287
guard isReachableFlagSet else { return .unavailable }
@@ -398,8 +398,8 @@ extension SCNetworkReachabilityFlags {
398398
- still allow for automatic stopping of the notifier on `deinit`.
399399
*/
400400
private class ReachabilityWeakifier {
401-
weak var reachability: ReachabilityKit?
402-
init(reachability: ReachabilityKit) {
401+
weak var reachability: Reachability?
402+
init(reachability: Reachability) {
403403
self.reachability = reachability
404404
}
405405
}

Tests/ReachabilityTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ReachabilityTests: XCTestCase {
1414
func testValidHost() {
1515
let validHostName = "google.com"
1616

17-
guard let reachability = try? ReachabilityKit(hostname: validHostName) else {
17+
guard let reachability = try? Reachability(hostname: validHostName) else {
1818
return XCTFail("Unable to create reachability")
1919
}
2020

@@ -47,7 +47,7 @@ class ReachabilityTests: XCTestCase {
4747

4848
let invalidHostName = "invalidhost"
4949

50-
guard let reachability = try? ReachabilityKit(hostname: invalidHostName) else {
50+
guard let reachability = try? Reachability(hostname: invalidHostName) else {
5151
return XCTFail("Unable to create reachability")
5252
}
5353

0 commit comments

Comments
 (0)