diff --git a/XCDYouTubeKit/XCDYouTubeClient.h b/XCDYouTubeKit/XCDYouTubeClient.h index 3e3a29fc..09b5e67f 100644 --- a/XCDYouTubeKit/XCDYouTubeClient.h +++ b/XCDYouTubeKit/XCDYouTubeClient.h @@ -124,7 +124,7 @@ NS_ASSUME_NONNULL_BEGIN * * @return A newly initialized`` object for canceling the asynchronous query operation. If you call the `cancel` method before the operation is finished, the completion handler will not be called. */ -- (XCDYouTubeVideoQueryOperation *) queryVideo:(XCDYouTubeVideo *)video cookies:(nullable NSArray *)cookies completionHandler:(void (^)(NSDictionary *streamURLs, NSError * __nullable error, NSDictionary *streamErrors))completionHandler; +- (XCDYouTubeVideoQueryOperation *) queryVideo:(XCDYouTubeVideo *)video cookies:(nullable NSArray *)cookies completionHandler:(void (^)(NSDictionary * __nullable streamURLs, NSError * __nullable error, NSDictionary * __nullable streamErrors))completionHandler; @end diff --git a/XCDYouTubeKit/XCDYouTubeClient.m b/XCDYouTubeKit/XCDYouTubeClient.m index 80475590..a0e75b3d 100644 --- a/XCDYouTubeKit/XCDYouTubeClient.m +++ b/XCDYouTubeKit/XCDYouTubeClient.m @@ -86,7 +86,7 @@ - (instancetype) initWithLanguageIdentifier:(NSString *)languageIdentifier return [self getVideoWithIdentifier:videoIdentifier cookies:cookies customPatterns:nil completionHandler:completionHandler]; } -- (XCDYouTubeVideoQueryOperation *) queryVideo:(XCDYouTubeVideo *)video cookies:(NSArray *)cookies completionHandler:(void (^)(NSDictionary * _Nonnull, NSError * _Nullable, NSDictionary *streamErrors))completionHandler +- (XCDYouTubeVideoQueryOperation *)queryVideo:(XCDYouTubeVideo *)video cookies:(NSArray *)cookies completionHandler:(void (^)(NSDictionary * _Nullable, NSError * _Nullable, NSDictionary * _Nullable))completionHandler { if (!completionHandler) @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"The `completionHandler` argument must not be nil." userInfo:nil]; diff --git a/XCDYouTubeKit/XCDYouTubeVideoQueryOperation.h b/XCDYouTubeKit/XCDYouTubeVideoQueryOperation.h index 0317e3d1..917218b8 100644 --- a/XCDYouTubeKit/XCDYouTubeVideoQueryOperation.h +++ b/XCDYouTubeKit/XCDYouTubeVideoQueryOperation.h @@ -36,9 +36,9 @@ NS_ASSUME_NONNULL_BEGIN /// A dictionary of video stream URLs that are reachable. The keys are the YouTube [itag](https://en.wikipedia.org/wiki/YouTube#Quality_and_formats) values as `NSNumber` objects. The values are the video URLs as `NSURL` objects. There is also the special `XCDYouTubeVideoQualityHTTPLiveStreaming` key for live videos. #if __has_feature(objc_generics) -@property (atomic, readonly) NSDictionary *streamURLs; +@property (atomic, readonly, nullable) NSDictionary *streamURLs; #else -@property (atomic, readonly) NSDictionary *streamURLs; +@property (atomic, readonly, nullable) NSDictionary *streamURLs; #endif /// Returns an error of the `XCDYouTubeVideoErrorDomain` domain if the operation failed or nil if it succeeded. The operation will only return an error if no stream URL is reachable (error code: `XCDYouTubeErrorNoStreamAvailable`). Also, this returns `nil` if the operation is not yet finished or if it was canceled.