AWSKSReachableOperation

Objective-C

@interface AWSKSReachableOperation : NSObject

Swift

class AWSKSReachableOperation : NSObject

A one-time operation to perform as soon as a host is deemed reachable.

  • The operation will only be performed once, regardless of how many times a
  • host becomes reachable.
  • Constructor. Returns nil if an initialization error occurs. *

    • - parameter: hostname The name or IP address of the host to monitor. If nil or
    • empty string, check reachability to the internet in general.
    • If hostname is a URL string, it will use the host portion. *
    • - parameter: allowWWAN If NO, a WWAN-only connection is not enough to trigger
    • this operation. *
    • - parameter: onReachabilityAchieved Invoke when the host becomes reachable.
    • This will be invoked ONE TIME ONLY, no matter
    • how many times reachability changes.
    • Block will be invoked on the main thread.

    Declaration

    Objective-C

    + (AWSKSReachableOperation *)operationWithHost:(NSString *)hostname
                                         allowWWAN:(BOOL)allowWWAN
                            onReachabilityAchieved:
                                (dispatch_block_t)onReachabilityAchieved;
  • Constructor. Returns nil if an initialization error occurs. *

    • - parameter: reachability A reachability instance. Note: This object will overwrite
    • the onReachabilityChanged property. *
    • - parameter: allowWWAN If NO, a WWAN-only connection is not enough to trigger
    • this operation. *
    • - parameter: onReachabilityAchieved Invoke when the host becomes reachable.
    • This will be invoked ONE TIME ONLY, no matter
    • how many times reachability changes.
    • Block will be invoked on the main thread.

    Declaration

    Objective-C

    + (AWSKSReachableOperation *)
        operationWithReachability:(AWSKSReachability *)reachability
                        allowWWAN:(BOOL)allowWWAN
           onReachabilityAchieved:(dispatch_block_t)onReachabilityAchieved;
  • Initializer. Returns nil if an initialization error occurs. *

    • - parameter: hostname The name or IP address of the host to monitor. If nil or
    • empty string, check reachability to the internet in general.
    • If hostname is a URL string, it will use the host portion. *
    • - parameter: allowWWAN If NO, a WWAN-only connection is not enough to trigger
    • this operation. *
    • - parameter: onReachabilityAchieved Invoke when the host becomes reachable.
    • This will be invoked ONE TIME ONLY, no matter
    • how many times reachability changes.
    • Block will be invoked on the main thread.

    Declaration

    Objective-C

    - (id)initWithHost:(NSString *)hostname
                     allowWWAN:(BOOL)allowWWAN
        onReachabilityAchieved:(dispatch_block_t)onReachabilityAchieved;

    Swift

    init!(host hostname: String!, allowWWAN: Bool, onReachabilityAchieved: (() -> Void)!)
  • Initializer. Returns nil if an initialization error occurs. *

    • - parameter: reachability A reachability instance. Note: This object will overwrite
    • the onReachabilityChanged property. *
    • - parameter: allowWWAN If NO, a WWAN-only connection is not enough to trigger
    • this operation. *
    • - parameter: onReachabilityAchieved Invoke when the host becomes reachable.
    • This will be invoked ONE TIME ONLY, no matter
    • how many times reachability changes.
    • Block will be invoked on the main thread.

    Declaration

    Objective-C

    - (id)initWithReachability:(AWSKSReachability *)reachability
                     allowWWAN:(BOOL)allowWWAN
        onReachabilityAchieved:(dispatch_block_t)onReachabilityAchieved;

    Swift

    init!(reachability: AWSKSReachability!, allowWWAN: Bool, onReachabilityAchieved: (() -> Void)!)
  • Access to internal reachability instance. Use this to monitor for errors.

    Declaration

    Objective-C

    @property (nonatomic, retain, readonly) AWSKSReachability *reachability;

    Swift

    var reachability: AWSKSReachability! { get }