Skip to content

Commit 3867c8a

Browse files
committed
Remove stale availability checks/annotations.
The current min version are above this (see GTMSessionFetcher.podspec or Package.swift), so none of these checks/annotations are needed.
1 parent 9972f88 commit 3867c8a

6 files changed

+14
-37
lines changed

Sources/Core/GTMSessionFetcher.m

+2-5
Original file line numberDiff line numberDiff line change
@@ -1993,9 +1993,7 @@ - (void)releaseCallbacks {
19931993
self.retryBlock = nil;
19941994
self.testBlock = nil;
19951995
self.resumeDataBlock = nil;
1996-
if (@available(iOS 10.0, *)) {
1997-
self.metricsCollectionBlock = nil;
1998-
}
1996+
self.metricsCollectionBlock = nil;
19991997
}
20001998

20011999
- (void)forgetSessionIdentifierForFetcher {
@@ -3114,8 +3112,7 @@ - (void)URLSession:(NSURLSession *)session
31143112

31153113
- (void)URLSession:(NSURLSession *)session
31163114
task:(NSURLSessionTask *)task
3117-
didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics
3118-
API_AVAILABLE(ios(10.0), macosx(10.12), tvos(10.0), watchos(6.0)) {
3115+
didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics {
31193116
@synchronized(self) {
31203117
GTMSessionMonitorSynchronized(self);
31213118
GTMSessionFetcherMetricsCollectionBlock metricsCollectionBlock = _metricsCollectionBlock;

Sources/Core/GTMSessionFetcherService.m

+2-5
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ - (id)fetcherWithRequest:(NSURLRequest *)request fetcherClass:(Class)fetcherClas
219219
fetcher.retryBlock = self.retryBlock;
220220
fetcher.maxRetryInterval = self.maxRetryInterval;
221221
fetcher.minRetryInterval = self.minRetryInterval;
222-
if (@available(iOS 10.0, *)) {
223-
fetcher.metricsCollectionBlock = self.metricsCollectionBlock;
224-
}
222+
fetcher.metricsCollectionBlock = self.metricsCollectionBlock;
225223
fetcher.stopFetchingTriggersCompletionHandler = self.stopFetchingTriggersCompletionHandler;
226224
fetcher.properties = self.properties;
227225
fetcher.service = self;
@@ -1333,8 +1331,7 @@ - (void)URLSession:(NSURLSession *)session
13331331

13341332
- (void)URLSession:(NSURLSession *)session
13351333
task:(NSURLSessionTask *)task
1336-
didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics
1337-
API_AVAILABLE(ios(10.0), macosx(10.12), tvos(10.0), watchos(6.0)) {
1334+
didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics {
13381335
id<NSURLSessionTaskDelegate> fetcher = [self fetcherForTask:task];
13391336
[fetcher URLSession:session task:task didFinishCollectingMetrics:metrics];
13401337
}

Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcher.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ typedef void (^GTMSessionFetcherRetryResponse)(BOOL shouldRetry);
503503
typedef void (^GTMSessionFetcherRetryBlock)(BOOL suggestedWillRetry, NSError *_Nullable error,
504504
GTMSessionFetcherRetryResponse response);
505505

506-
API_AVAILABLE(ios(10.0), macosx(10.12), tvos(10.0), watchos(6.0))
507506
typedef void (^GTMSessionFetcherMetricsCollectionBlock)(NSURLSessionTaskMetrics *metrics);
508507

509508
typedef void (^GTMSessionFetcherTestResponse)(NSHTTPURLResponse *_Nullable response,
@@ -1077,9 +1076,7 @@ __deprecated_msg("implement GTMSessionFetcherAuthorizer instead")
10771076
// The optional block for collecting the metrics of the present session.
10781077
//
10791078
// This is called on the callback queue.
1080-
@property(atomic, copy, nullable)
1081-
GTMSessionFetcherMetricsCollectionBlock metricsCollectionBlock API_AVAILABLE(
1082-
ios(10.0), macosx(10.12), tvos(10.0), watchos(6.0));
1079+
@property(atomic, copy, nullable) GTMSessionFetcherMetricsCollectionBlock metricsCollectionBlock;
10831080

10841081
// Retry intervals must be strictly less than maxRetryInterval, else
10851082
// they will be limited to maxRetryInterval and no further retries will

Sources/Core/Public/GTMSessionFetcher/GTMSessionFetcherService.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ extern NSString *const kGTMSessionFetcherServiceSessionKey;
6565
@property(atomic, assign) NSTimeInterval maxRetryInterval;
6666
@property(atomic, assign) NSTimeInterval minRetryInterval;
6767
@property(atomic, copy, nullable) NSDictionary<NSString *, id> *properties;
68-
@property(atomic, copy, nullable)
69-
GTMSessionFetcherMetricsCollectionBlock metricsCollectionBlock API_AVAILABLE(
70-
ios(10.0), macosx(10.12), tvos(10.0), watchos(6.0));
68+
@property(atomic, copy, nullable) GTMSessionFetcherMetricsCollectionBlock metricsCollectionBlock;
7169
@property(atomic, assign) BOOL stopFetchingTriggersCompletionHandler;
7270

7371
#if GTM_BACKGROUND_TASK_FETCHING

UnitTests/GTMSessionFetcherFetchingTest.m

+7-16
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ - (void)assertCallbacksReleasedForFetcher:(GTMSessionFetcher *)fetcher {
179179
XCTAssertNil(fetcher.downloadProgressBlock);
180180
XCTAssertNil(fetcher.willCacheURLResponseBlock);
181181
XCTAssertNil(fetcher.retryBlock);
182-
if (@available(iOS 10.0, *)) {
183-
XCTAssertNil(fetcher.metricsCollectionBlock);
184-
}
182+
XCTAssertNil(fetcher.metricsCollectionBlock);
185183
XCTAssertNil(fetcher.testBlock);
186184

187185
if ([fetcher isKindOfClass:[GTMSessionUploadFetcher class]]) {
@@ -2162,8 +2160,7 @@ - (void)testInsecureRequests_WithoutFetcherService {
21622160
[self testInsecureRequests];
21632161
}
21642162

2165-
- (void)testCollectingMetrics_WithSuccessfulFetch API_AVAILABLE(ios(10.0), macosx(10.12),
2166-
tvos(10.0), watchos(6.0)) {
2163+
- (void)testCollectingMetrics_WithSuccessfulFetch {
21672164
if (!_isServerRunning) return;
21682165

21692166
CREATE_START_STOP_NOTIFICATION_EXPECTATIONS(1, 1);
@@ -2197,15 +2194,12 @@ - (void)testCollectingMetrics_WithSuccessfulFetch API_AVAILABLE(ios(10.0), macos
21972194
XCTAssertNotNil(collectedMetrics.transactionMetrics[0].responseEndDate);
21982195
}
21992196

2200-
- (void)testCollectingMetrics_WithSuccessfulFetch_WithoutFetcherService API_AVAILABLE(
2201-
ios(10.0), macosx(10.12), tvos(10.0), watchos(6.0)) {
2197+
- (void)testCollectingMetrics_WithSuccessfulFetch_WithoutFetcherService {
22022198
_fetcherService = nil;
22032199
[self testCollectingMetrics_WithSuccessfulFetch];
22042200
}
22052201

2206-
- (void)testCollectingMetrics_WithWrongFetch_FaildToConnect API_AVAILABLE(ios(10.0), macosx(10.12),
2207-
tvos(10.0),
2208-
watchos(6.0)) {
2202+
- (void)testCollectingMetrics_WithWrongFetch_FaildToConnect {
22092203
if (!_isServerRunning) return;
22102204

22112205
CREATE_START_STOP_NOTIFICATION_EXPECTATIONS(1, 1);
@@ -2243,14 +2237,12 @@ - (void)testCollectingMetrics_WithWrongFetch_FaildToConnect API_AVAILABLE(ios(10
22432237
XCTAssertNil(collectedMetrics.transactionMetrics[0].responseEndDate);
22442238
}
22452239

2246-
- (void)testCollectingMetrics_WithWrongFetch_FaildToConnect_WithoutFetcherService API_AVAILABLE(
2247-
ios(10.0), macosx(10.12), tvos(10.0), watchos(6.0)) {
2240+
- (void)testCollectingMetrics_WithWrongFetch_FaildToConnect_WithoutFetcherService {
22482241
_fetcherService = nil;
22492242
[self testCollectingMetrics_WithWrongFetch_FaildToConnect];
22502243
}
22512244

2252-
- (void)testCollectingMetrics_WithWrongFetch_BadStatusCode API_AVAILABLE(ios(10.0), macosx(10.12),
2253-
tvos(10.0), watchos(6.0)) {
2245+
- (void)testCollectingMetrics_WithWrongFetch_BadStatusCode {
22542246
if (!_isServerRunning) return;
22552247

22562248
CREATE_START_STOP_NOTIFICATION_EXPECTATIONS(1, 1);
@@ -2290,8 +2282,7 @@ - (void)testCollectingMetrics_WithWrongFetch_BadStatusCode API_AVAILABLE(ios(10.
22902282
XCTAssertNotNil(collectedMetrics.transactionMetrics[0].responseEndDate);
22912283
}
22922284

2293-
- (void)testCollectingMetrics_WithWrongFetch_BadStatusCode_WithoutFetcherService API_AVAILABLE(
2294-
ios(10.0), macosx(10.12), tvos(10.0), watchos(6.0)) {
2285+
- (void)testCollectingMetrics_WithWrongFetch_BadStatusCode_WithoutFetcherService {
22952286
_fetcherService = nil;
22962287
[self testCollectingMetrics_WithWrongFetch_BadStatusCode];
22972288
}

UnitTests/GTMSessionFetcherServiceTest.m

+1-4
Original file line numberDiff line numberDiff line change
@@ -1751,10 +1751,7 @@ - (void)testDelegateDispatcherForFetcher {
17511751
[session invalidateAndCancel];
17521752
}
17531753

1754-
- (void)testFetcherUsingMetricsCollectionBlockFromFetcherService API_AVAILABLE(ios(10.0),
1755-
macosx(10.12),
1756-
tvos(10.0),
1757-
watchos(6.0)) {
1754+
- (void)testFetcherUsingMetricsCollectionBlockFromFetcherService {
17581755
if (!_isServerRunning) return;
17591756

17601757
CREATE_START_STOP_NOTIFICATION_EXPECTATIONS(1, 1);

0 commit comments

Comments
 (0)