From e99e35f7dcce3f79ce85e7c4e56e1b686f1b5115 Mon Sep 17 00:00:00 2001 From: Marijus Kilmanas Date: Tue, 29 Nov 2016 08:58:25 +0200 Subject: [PATCH] Add shorthand method to check if status is one of .online --- Reach-swift3.0/Reach.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Reach-swift3.0/Reach.swift b/Reach-swift3.0/Reach.swift index 67913f2..69c28a1 100644 --- a/Reach-swift3.0/Reach.swift +++ b/Reach-swift3.0/Reach.swift @@ -51,6 +51,16 @@ enum ReachabilityStatus: CustomStringConvertible { case .unknown: return "Unknown" } } + + func isOnline() -> Bool { + switch self { + case .online(.wwan), .online(.wiFi): + return true; + + default: + return false; + } + } } public class Reach {