File tree 5 files changed +37
-113
lines changed
5 files changed +37
-113
lines changed Original file line number Diff line number Diff line change 38
38
#import " PostTag.h"
39
39
#import " PostTagService.h"
40
40
41
- #import " ReachabilityUtils.h"
42
41
#import " ReaderGapMarker.h"
43
42
#import " ReaderPost.h"
44
43
#import " ReaderPostService.h"
Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
3
- private var currentReachabilityAlert : _ReachabilityAlert ?
3
+ var currentReachabilityAlert : ReachabilityAlert ?
4
4
5
- class _ReachabilityAlert : NSObject {
5
+ class ReachabilityAlert : NSObject {
6
6
7
7
let retryBlock : ( ( ) -> Void ) ?
8
8
@@ -38,6 +38,6 @@ class _ReachabilityAlert: NSObject {
38
38
// Note: This viewController might not be visible anymore
39
39
alertController. presentFromRootViewController ( )
40
40
41
- currentReachabilityAlert = self ;
41
+ currentReachabilityAlert = self
42
42
}
43
43
}
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import Foundation
2
+
3
+ @objc
4
+ public class ReachabilityUtils : NSObject {
5
+
6
+ @objc
7
+ public static func isInternetReachable( ) -> Bool {
8
+ ( UIApplication . shared as? NetworkConnectionAvailabilityGetting ) ? . connectionAvailable ?? false
9
+ }
10
+
11
+ @objc
12
+ public static func showAlertNoInternetConnection( ) {
13
+ ReachabilityAlert ( retryBlock: nil ) . show ( )
14
+ }
15
+
16
+ @objc
17
+ public static func showAlertNoInternetConnection( retryBlock: ( ( ) -> Void ) ? = nil ) {
18
+ ReachabilityAlert ( retryBlock: retryBlock) . show ( )
19
+ }
20
+
21
+ @objc
22
+ public static func noConnectionMessage( ) -> String {
23
+ NSLocalizedString (
24
+ " reachability-utils.alert.utils " ,
25
+ value: " The internet connection appears to be offline. " ,
26
+ comment: " Message of error prompt shown when no internet connection is available "
27
+ )
28
+ }
29
+
30
+ @objc
31
+ public static func isAlertShowing( ) -> Bool {
32
+ currentReachabilityAlert != nil
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments