diff --git a/src/platform/ios/PAGDecoder.h b/src/platform/ios/PAGDecoder.h index 87be9976d7..c432e8ba22 100644 --- a/src/platform/ios/PAGDecoder.h +++ b/src/platform/ios/PAGDecoder.h @@ -20,8 +20,6 @@ #import #import "PAGComposition.h" -NS_ASSUME_NONNULL_BEGIN - /** * PAGDecoder provides a utility to read image frames directly from a PAGComposition, and caches the * image frames as a sequence file on the disk, which may significantly speed up the reading process @@ -86,14 +84,14 @@ PAG_API @interface PAGDecoder : NSObject * if failed. Note that caller must ensure that the rowBytes stays the same throughout every copying * call. Otherwise, it may return false. */ -- (BOOL)copyFrameTo:(void*)pixels rowBytes:(size_t)rowBytes at:(NSInteger)index; +- (BOOL)copyFrameTo:(void* _Nonnull)pixels rowBytes:(size_t)rowBytes at:(NSInteger)index; /** * Reads pixels of the image frame at the given index into the specified CVPixelBuffer. Returns * false if failed. Reading image frames into HardwareBuffer usually has better performance than * reading into memory. */ -- (BOOL)readFrame:(NSInteger)index to:(CVPixelBufferRef)pixelBuffer; +- (BOOL)readFrame:(NSInteger)index to:(CVPixelBufferRef _Nonnull)pixelBuffer; /** * Returns the image frame at the specified index. Note that this method must be called while the @@ -103,5 +101,3 @@ PAG_API @interface PAGDecoder : NSObject - (nullable UIImage*)frameAtIndex:(NSInteger)index; @end - -NS_ASSUME_NONNULL_END diff --git a/src/platform/ios/PAGImageView.h b/src/platform/ios/PAGImageView.h index 43fb15b771..0c1ecc4fa6 100644 --- a/src/platform/ios/PAGImageView.h +++ b/src/platform/ios/PAGImageView.h @@ -19,8 +19,6 @@ #import #import "PAGComposition.h" -NS_ASSUME_NONNULL_BEGIN - @class PAGImageView; @protocol PAGImageViewListener @@ -30,29 +28,29 @@ NS_ASSUME_NONNULL_BEGIN * Notifies the beginning of the animation. It can be called from either the UI thread or the thread * that calls the play method. */ -- (void)onAnimationStart:(PAGImageView*)pagView; +- (void)onAnimationStart:(PAGImageView* _Nonnull)pagView; /** * Notifies the end of the animation. It can only be called from the UI thread. */ -- (void)onAnimationEnd:(PAGImageView*)pagView; +- (void)onAnimationEnd:(PAGImageView* _Nonnull)pagView; /** * Notifies the cancellation of the animation. It can be called from either the UI thread or the * thread that calls the stop method. */ -- (void)onAnimationCancel:(PAGImageView*)pagView; +- (void)onAnimationCancel:(PAGImageView* _Nonnull)pagView; /** * Notifies the repetition of the animation. It can only be called from the UI thread. */ -- (void)onAnimationRepeat:(PAGImageView*)pagView; +- (void)onAnimationRepeat:(PAGImageView* _Nonnull)pagView; /** * Notifies another frame of the animation has occurred. It may be called from an arbitrary * thread if the animation is running asynchronously. */ -- (void)onAnimationUpdate:(PAGImageView*)pagView; +- (void)onAnimationUpdate:(PAGImageView* _Nonnull)pagView; @end @@ -82,14 +80,14 @@ PAG_API @interface PAGImageView : UIImageView * composition is already added to another PAGImageView, it will be removed from the previous * PAGImageView. */ -- (void)setComposition:(PAGComposition*)newComposition; +- (void)setComposition:(nullable PAGComposition*)newComposition; /** * Sets a new PAGComposition and the maxFrameRate limit to the PAGImageView. Note: If the * composition is already added to another PAGImageView, it will be removed from the previous * PAGImageView. */ -- (void)setComposition:(PAGComposition*)newComposition maxFrameRate:(float)maxFrameRate; +- (void)setComposition:(nullable PAGComposition*)newComposition maxFrameRate:(float)maxFrameRate; /** * Returns the file path set by the setPath() method. @@ -100,27 +98,28 @@ PAG_API @interface PAGImageView : UIImageView * Loads a pag file from the specified path, returns false if the file does not exist, or it is not * a valid pag file. */ -- (BOOL)setPath:(NSString*)path; +- (BOOL)setPath:(nullable NSString*)path; /** * Loads a pag file from the specified path with the maxFrameRate limit, returns false if the file * does not exist, or it is not a valid pag file. */ -- (BOOL)setPath:(NSString*)filePath maxFrameRate:(float)maxFrameRate; +- (BOOL)setPath:(nullable NSString*)filePath maxFrameRate:(float)maxFrameRate; /** * Asynchronously load a PAG file from the specific path, a block with PAGFile will be called * when loading is complete. If loading fails, PAGFile will be set to nil. */ -- (void)setPathAsync:(NSString*)filePath completionBlock:(void (^)(PAGFile* __nullable))callback; +- (void)setPathAsync:(nullable NSString*)filePath + completionBlock:(void (^_Nullable)(PAGFile* __nullable))callback; /** * Asynchronously load a PAG file from the specific path with the maxFrameRate limit, a block * with PAGFile will be called when loading is complete. If loading fails, PAGFile will be set to * nil. */ -- (void)setPathAsync:(NSString*)filePath +- (void)setPathAsync:(nullable NSString*)filePath maxFrameRate:(float)maxFrameRate - completionBlock:(void (^)(PAGFile* __nullable))callback; + completionBlock:(void (^_Nullable)(PAGFile* __nullable))callback; /** * If set to true, the PAGImageView loads all image frames into the memory, which will significantly @@ -163,12 +162,12 @@ PAG_API @interface PAGImageView : UIImageView * Adds a listener to the set of listeners that are sent events through the life of an animation, * such as start, repeat, and end. PAGImageView only holds a weak reference to the listener. */ -- (void)addListener:(id)listener; +- (void)addListener:(nullable id)listener; /** * Removes the specified listener from the set of listeners */ -- (void)removeListener:(id)listener; +- (void)removeListener:(nullable id)listener; /** * Returns the current frame index the PAGImageView is rendering. @@ -189,7 +188,7 @@ PAG_API @interface PAGImageView : UIImageView /** * Returns a UIImage capturing the contents of the current PAGImageView. */ -- (UIImage*)currentImage; +- (nullable UIImage*)currentImage; /** * Starts to play the animation from the current position. Calling the play() method when the @@ -219,5 +218,3 @@ PAG_API @interface PAGImageView : UIImageView - (BOOL)flush; @end - -NS_ASSUME_NONNULL_END diff --git a/src/platform/ios/private/PAGContentVersion.h b/src/platform/ios/private/PAGContentVersion.h index 5b18f3dcda..17301b13dd 100644 --- a/src/platform/ios/private/PAGContentVersion.h +++ b/src/platform/ios/private/PAGContentVersion.h @@ -21,11 +21,7 @@ #import "platform/cocoa/PAGComposition.h" #import "platform/ios/PAGDecoder.h" -NS_ASSUME_NONNULL_BEGIN - @interface PAGContentVersion : NSObject + (NSInteger)Get:(PAGComposition*)pagComposition; @end - -NS_ASSUME_NONNULL_END