diff --git a/FSImageViewer/FSBasicImage.h b/FSImageViewer/FSBasicImage.h index c6b4a7b..3735ec7 100644 --- a/FSImageViewer/FSBasicImage.h +++ b/FSImageViewer/FSBasicImage.h @@ -29,16 +29,16 @@ /// @param URL remote image URL /// @param name title of the image -- (instancetype)initWithImageURL:(NSURL *)URL name:(NSString *)name; +- (instancetype _Nonnull)initWithImageURL:(NSURL * _Nonnull)URL name:(NSString * _Nullable)name; /// @param URL remote image URL -- (instancetype)initWithImageURL:(NSURL *)URL; +- (instancetype _Nonnull)initWithImageURL:(NSURL * _Nonnull)URL; /// @param image an UIImage representation of the image -- (instancetype)initWithImage:(UIImage *)image; +- (instancetype _Nonnull)initWithImage:(UIImage * _Nonnull)image; /// @param image an UIImage representation of the image /// @param name title of the image -- (instancetype)initWithImage:(UIImage *)image name:(NSString *)name; +- (instancetype _Nonnull)initWithImage:(UIImage * _Nonnull)image name:(NSString * _Nullable)name; @end diff --git a/FSImageViewer/FSBasicImageSource.h b/FSImageViewer/FSBasicImageSource.h index df5e125..7eff79c 100644 --- a/FSImageViewer/FSBasicImageSource.h +++ b/FSImageViewer/FSBasicImageSource.h @@ -29,6 +29,6 @@ @interface FSBasicImageSource : NSObject /// @param images array of FSImage objects -- (instancetype)initWithImages:(NSArray>*)images; +- (instancetype _Nonnull)initWithImages:(NSArray>* _Nonnull)images; @end diff --git a/FSImageViewer/FSBasicImageSource.m b/FSImageViewer/FSBasicImageSource.m index dfbdfee..e1fac2c 100644 --- a/FSImageViewer/FSBasicImageSource.m +++ b/FSImageViewer/FSBasicImageSource.m @@ -29,7 +29,7 @@ @implementation FSBasicImageSource @synthesize images = _images; @synthesize numberOfImages = _numberOfImages; -- (instancetype)initWithImages:(NSArray>*)images{ +- (instancetype _Nonnull)initWithImages:(NSArray>* _Nonnull)images{ if (self = [super init]) { _images = images; diff --git a/FSImageViewer/FSImageLoader.h b/FSImageViewer/FSImageLoader.h index 5e05311..8c5239b 100644 --- a/FSImageViewer/FSImageLoader.h +++ b/FSImageViewer/FSImageLoader.h @@ -24,6 +24,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + /// Download remote images with AFNetworking @interface FSImageLoader : NSObject @@ -36,7 +38,7 @@ /// Download remote images from url /// @param url remote image url /// @param imageBlock block for image or error -- (void)loadImageForURL:(NSURL *)url progress:(void (^)(float progress))progress image:(void (^)(UIImage *image, NSError *error))imageBlock; +- (void)loadImageForURL:(NSURL * _Nonnull)url progress:(void (^)(float progress))progress image:(void (^)(UIImage * __nullable image, NSError * __nullable error))imageBlock; /// Cancel all image requests - (void)cancelAllRequests; @@ -45,4 +47,6 @@ /// @param url remote image url - (void)cancelRequestForUrl:(NSURL *)url; +NS_ASSUME_NONNULL_END + @end \ No newline at end of file diff --git a/FSImageViewer/FSImageViewerViewController.h b/FSImageViewer/FSImageViewerViewController.h index 3a39b25..2969c62 100644 --- a/FSImageViewer/FSImageViewerViewController.h +++ b/FSImageViewer/FSImageViewerViewController.h @@ -26,6 +26,8 @@ #import "FSImageSource.h" #import "FSTitleView.h" +NS_ASSUME_NONNULL_BEGIN + @class FSImageViewerViewController; // Optional Delegate for getting current presented image index. @@ -55,16 +57,16 @@ @property(strong, nonatomic, readonly) id imageSource; /// Title -@property(strong, nonatomic) UIView* titleView; +@property(strong, nonatomic, nullable) UIView* titleView; /// Optional Delegate -@property(weak, nonatomic) id delegate; +@property(weak, nonatomic, nullable) id delegate; /// FSImageView array -@property(strong, nonatomic) NSMutableArray *imageViews; +@property(strong, nonatomic, nullable) NSMutableArray *imageViews; /// Main scrollView -@property(strong, nonatomic) UIScrollView *scrollView; +@property(strong, nonatomic, nullable) UIScrollView *scrollView; /// Display a "x of y" images in the navigation title - Default is YES @property(assign, nonatomic) BOOL showNumberOfItemsInTitle; @@ -76,19 +78,19 @@ @property(assign, nonatomic, getter = isRotationEnabled) BOOL rotationEnabled; /// Override the background color when overlay is hidden - Default is black -@property(strong, nonatomic) UIColor *backgroundColorHidden; +@property(strong, nonatomic, nullable) UIColor *backgroundColorHidden; /// Override the background color when overlay is visible - Default is white -@property(strong, nonatomic) UIColor *backgroundColorVisible; +@property(strong, nonatomic, nullable) UIColor *backgroundColorVisible; /// Override the progressView color when overlay is hidden - Default is white -@property(strong, nonatomic) UIColor *progressColorHidden; +@property(strong, nonatomic, nullable) UIColor *progressColorHidden; /// Override the progressView color when overlay is visible - Default is darkGrayColor -@property(strong, nonatomic) UIColor *progressColorVisible; +@property(strong, nonatomic, nullable) UIColor *progressColorVisible; /// Used to add additional items to the "share" button -@property(strong, nonatomic) NSArray* applicationActivities; +@property(strong, nonatomic, nullable) NSArray* applicationActivities; /// Current index of the image displayed /// @return current index of the image displayed @@ -99,4 +101,6 @@ /// @param animated should the movevement animated - (void)moveToImageAtIndex:(NSInteger)index animated:(BOOL)animated; +NS_ASSUME_NONNULL_END + @end \ No newline at end of file diff --git a/FSImageViewer/FSPlaceholderImages.h b/FSImageViewer/FSPlaceholderImages.h index 38b9db7..92a80d5 100644 --- a/FSImageViewer/FSPlaceholderImages.h +++ b/FSImageViewer/FSPlaceholderImages.h @@ -26,6 +26,6 @@ @interface FSPlaceholderImages : NSObject -+ (UIImage *)errorImage; ++ (UIImage * _Nonnull)errorImage; @end \ No newline at end of file