Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Use nonnull
Browse files Browse the repository at this point in the history
  • Loading branch information
x2on committed Sep 19, 2015
1 parent 3f0a750 commit 7c8df59
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
8 changes: 4 additions & 4 deletions FSImageViewer/FSBasicImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion FSImageViewer/FSBasicImageSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
@interface FSBasicImageSource : NSObject<FSImageSource>

/// @param images array of FSImage objects
- (instancetype)initWithImages:(NSArray<id <FSImage>>*)images;
- (instancetype _Nonnull)initWithImages:(NSArray<id <FSImage>>* _Nonnull)images;

@end
2 changes: 1 addition & 1 deletion FSImageViewer/FSBasicImageSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ @implementation FSBasicImageSource
@synthesize images = _images;
@synthesize numberOfImages = _numberOfImages;

- (instancetype)initWithImages:(NSArray<id <FSImage>>*)images{
- (instancetype _Nonnull)initWithImages:(NSArray<id <FSImage>>* _Nonnull)images{

if (self = [super init]) {
_images = images;
Expand Down
6 changes: 5 additions & 1 deletion FSImageViewer/FSImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/// Download remote images with AFNetworking
@interface FSImageLoader : NSObject

Expand All @@ -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;
Expand All @@ -45,4 +47,6 @@
/// @param url remote image url
- (void)cancelRequestForUrl:(NSURL *)url;

NS_ASSUME_NONNULL_END

@end
22 changes: 13 additions & 9 deletions FSImageViewer/FSImageViewerViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#import "FSImageSource.h"
#import "FSTitleView.h"

NS_ASSUME_NONNULL_BEGIN

@class FSImageViewerViewController;

// Optional Delegate for getting current presented image index.
Expand Down Expand Up @@ -55,16 +57,16 @@
@property(strong, nonatomic, readonly) id <FSImageSource> imageSource;

/// Title
@property(strong, nonatomic) UIView<FSTitleView>* titleView;
@property(strong, nonatomic, nullable) UIView<FSTitleView>* titleView;

/// Optional Delegate
@property(weak, nonatomic) id<FSImageViewerViewControllerDelegate> delegate;
@property(weak, nonatomic, nullable) id<FSImageViewerViewControllerDelegate> 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;
Expand All @@ -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
Expand All @@ -99,4 +101,6 @@
/// @param animated should the movevement animated
- (void)moveToImageAtIndex:(NSInteger)index animated:(BOOL)animated;

NS_ASSUME_NONNULL_END

@end
2 changes: 1 addition & 1 deletion FSImageViewer/FSPlaceholderImages.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

@interface FSPlaceholderImages : NSObject

+ (UIImage *)errorImage;
+ (UIImage * _Nonnull)errorImage;

@end

0 comments on commit 7c8df59

Please sign in to comment.