Change `Reachability` to an enum (#4941)

Since it's already acting as a namespace, might as well make it so it
can't be instantiated and can't have instance properties.
This commit is contained in:
JP Simard 2023-04-26 13:55:17 -04:00 committed by GitHub
parent 4abcf5f0dd
commit 8a21549ca9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -2,15 +2,15 @@
import SystemConfiguration
#endif
/// Helper class providing the static helper method `isConnectedToNetwork()`
internal class Reachability {
/// Helper enum providing the static var `connectivityStatus`
enum Reachability {
enum ConnectivityStatus {
case connected, disconnected, unknown
}
/// Returns whether the device is connected to a network, if known.
/// On Linux, this always evaluates to `nil`.
internal static var connectivityStatus: ConnectivityStatus {
static var connectivityStatus: ConnectivityStatus {
#if os(Linux)
return .unknown
#else