Skip to content

Commit

Permalink
Added nullability tags to DTReachability
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Nov 27, 2017
1 parent c4b6dcc commit 2ab619a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Core/Source/DTReachability/DTReachability.h
Expand Up @@ -38,7 +38,7 @@


// block type for the reachability observers
typedef void(^DTReachabilityObserverBlock)(DTReachabilityInformation *reachabilityInformation);
typedef void(^DTReachabilityObserverBlock)(DTReachabilityInformation * _Nonnull reachabilityInformation);


/**
Expand All @@ -54,22 +54,22 @@ typedef void(^DTReachabilityObserverBlock)(DTReachabilityInformation *reachabili
@returns An initialized DTReachability instance.
*/
- (instancetype)init;
- (instancetype _Nonnull)init;

/**
Returns an initialized DTReachability instance with a given host name
@param hostname The host name to monitor
@returns An initialized DTReachability instance.
*/
- (instancetype)initWithHostname:(NSString *)hostname;
- (instancetype _Nonnull)initWithHostname:(NSString * _Nonnull)hostname;

/**
Returns a shared DTReachability instance with the default hostname is apple.com. Generally you should use this because each DTReachability instance maintains its own table of observers.
@returns the default DTReachability instance
*/
+ (DTReachability *)defaultReachability;
+ (DTReachability * _Nonnull)defaultReachability;


/**
Expand All @@ -78,38 +78,38 @@ typedef void(^DTReachabilityObserverBlock)(DTReachabilityInformation *reachabili
@param observer An observation block
@returns An opaque reference to the observer which you can use to remove it
*/
+ (id)addReachabilityObserverWithBlock:(DTReachabilityObserverBlock)observer __attribute__((deprecated("use -[[DTReachability defaultReachability] addReachabilityObserverWithBlock:]")));
+ (_Nonnull id)addReachabilityObserverWithBlock:(DTReachabilityObserverBlock _Nonnull )observer __attribute__((deprecated("use -[[DTReachability defaultReachability] addReachabilityObserverWithBlock:]")));


/**
Removes a reachability observer.
@warning use -[[DTReachability defaultReachability] removeReachabilityObserver:]
@param observer The opaque reference to a reachability observer
*/
+ (void)removeReachabilityObserver:(id)observer __attribute__((deprecated("use -[[DTReachability defaultReachability] removeReachabilityObserver:]")));
+ (void)removeReachabilityObserver:(id _Nonnull)observer __attribute__((deprecated("use -[[DTReachability defaultReachability] removeReachabilityObserver:]")));

/**
Adds a block to observe network reachability. Every time the reachability flags change this block is invoked. Also once right after adding the observer with the current state.
@param observer An observation block
@returns An opaque reference to the observer which you can use to remove it
*/
- (id)addReachabilityObserverWithBlock:(DTReachabilityObserverBlock)observer;
- (id _Nonnull)addReachabilityObserverWithBlock:(DTReachabilityObserverBlock _Nonnull)observer;


/**
Removes a reachability observer block from the receiver.
@param observer The opaque reference to a reachability observer
*/
- (void)removeReachabilityObserver:(id)observer;
- (void)removeReachabilityObserver:(id _Nonnull)observer;


/**
Changes the hostname that is monitored for the receiver. All registered observer blocks will be called on reachability changes for the new hostname.
@param hostname The new hostname that is monitored
*/
- (void)setHostname:(NSString *)hostname;
- (void)setHostname:(NSString * _Nonnull) hostname;


@end

0 comments on commit 2ab619a

Please sign in to comment.