mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-02-11 00:00:08 +08:00
Add callback argument to start tracking method and hide reachability status changed block
This commit is contained in:
@@ -13,11 +13,10 @@
|
||||
|
||||
@property (readonly, nonatomic) BOOL isTracking;
|
||||
@property (readonly, nonatomic) OpenVPNReachabilityStatus reachabilityStatus;
|
||||
@property (copy, nonatomic) void (^ _Nullable reachabilityStatusChangedBlock)(OpenVPNReachabilityStatus reachabilityStatus);
|
||||
|
||||
- (nonnull instancetype)init;
|
||||
|
||||
- (void)startTracking;
|
||||
- (void)startTrackingWithCallback:(nullable void (^)(OpenVPNReachabilityStatus))callback;
|
||||
- (void)stopTracking;
|
||||
|
||||
@end
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
}
|
||||
|
||||
@property (assign, nonatomic) OpenVPNReachabilityTracker *reachabilityTracker;
|
||||
@property (copy, nonatomic) void (^ reachabilityStatusChangedBlock)(OpenVPNReachabilityStatus);
|
||||
|
||||
@end
|
||||
|
||||
@@ -50,7 +51,9 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)startTracking {
|
||||
- (void)startTrackingWithCallback:(void (^)(OpenVPNReachabilityStatus))callback {
|
||||
self.reachabilityStatusChangedBlock = callback;
|
||||
|
||||
dispatch_queue_t main = dispatch_get_main_queue();
|
||||
dispatch_async(main, ^{
|
||||
self.reachabilityTracker->reachability_tracker_schedule();
|
||||
|
||||
Reference in New Issue
Block a user