Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4138 from AFNetworking/unguarded-availability
Browse files Browse the repository at this point in the history
Use @available if available to silence a warning.
  • Loading branch information
SlaunchaMan authored Jan 27, 2018
2 parents 78ce859 + b327667 commit e976d63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AFNetworking/AFURLSessionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ - (instancetype)initWithTask:(NSURLSessionTask *)task {
progress.pausingHandler = ^{
[weakTask suspend];
};
#if __has_warning("-Wunguarded-availability-new")
if (@available(iOS 9, macOS 10.11, *)) {
#else
if ([progress respondsToSelector:@selector(setResumingHandler:)]) {
#endif
progress.resumingHandler = ^{
[weakTask resume];
};
Expand Down

0 comments on commit e976d63

Please sign in to comment.