mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-06 00:00:03 +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) BOOL isTracking;
|
||||||
@property (readonly, nonatomic) OpenVPNReachabilityStatus reachabilityStatus;
|
@property (readonly, nonatomic) OpenVPNReachabilityStatus reachabilityStatus;
|
||||||
@property (copy, nonatomic) void (^ _Nullable reachabilityStatusChangedBlock)(OpenVPNReachabilityStatus reachabilityStatus);
|
|
||||||
|
|
||||||
- (nonnull instancetype)init;
|
- (nonnull instancetype)init;
|
||||||
|
|
||||||
- (void)startTracking;
|
- (void)startTrackingWithCallback:(nullable void (^)(OpenVPNReachabilityStatus))callback;
|
||||||
- (void)stopTracking;
|
- (void)stopTracking;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@property (assign, nonatomic) OpenVPNReachabilityTracker *reachabilityTracker;
|
@property (assign, nonatomic) OpenVPNReachabilityTracker *reachabilityTracker;
|
||||||
|
@property (copy, nonatomic) void (^ reachabilityStatusChangedBlock)(OpenVPNReachabilityStatus);
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -50,7 +51,9 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)startTracking {
|
- (void)startTrackingWithCallback:(void (^)(OpenVPNReachabilityStatus))callback {
|
||||||
|
self.reachabilityStatusChangedBlock = callback;
|
||||||
|
|
||||||
dispatch_queue_t main = dispatch_get_main_queue();
|
dispatch_queue_t main = dispatch_get_main_queue();
|
||||||
dispatch_async(main, ^{
|
dispatch_async(main, ^{
|
||||||
self.reachabilityTracker->reachability_tracker_schedule();
|
self.reachabilityTracker->reachability_tracker_schedule();
|
||||||
|
|||||||
Reference in New Issue
Block a user