From 4240ee618df744ab39b809d71cd9ec901164d0a7 Mon Sep 17 00:00:00 2001 From: Jerome Morissard Date: Sun, 4 Sep 2016 20:00:33 +0200 Subject: [PATCH] FIX warnings --- Pod/Classes/JMActionSheet.h | 2 +- Pod/Classes/JMActionSheetCollectionItemCell.h | 8 ++++---- Pod/Classes/JMActionSheetImagesItem.h | 2 +- Pod/Classes/JMActionSheetItem.h | 10 +++++----- Pod/Classes/JMDatePickerActionSheet.m | 6 ++++-- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Pod/Classes/JMActionSheet.h b/Pod/Classes/JMActionSheet.h index 9bbad8c..33b0cdb 100644 --- a/Pod/Classes/JMActionSheet.h +++ b/Pod/Classes/JMActionSheet.h @@ -34,7 +34,7 @@ * @param viewController the parent view controller * @param view the parent view in hierarchy */ -+ (void)showActionSheetDescription:(nonnull JMActionSheetDescription *)actionSheetDescription inViewController:(nonnull UIViewController *)viewController fromView:(UIView *)view; ++ (void)showActionSheetDescription:(nonnull JMActionSheetDescription *)actionSheetDescription inViewController:(nonnull UIViewController *)viewController fromView:(nonnull UIView *)view; /** * Present a actionSheet like controller, generated using your description and inside a particular view and with arrow directions constraint. diff --git a/Pod/Classes/JMActionSheetCollectionItemCell.h b/Pod/Classes/JMActionSheetCollectionItemCell.h index 841af8f..42a2a2f 100644 --- a/Pod/Classes/JMActionSheetCollectionItemCell.h +++ b/Pod/Classes/JMActionSheetCollectionItemCell.h @@ -10,9 +10,9 @@ @interface JMActionSheetCollectionItemCell : UICollectionViewCell -- (void)updateCollectionViewCellWithObject:(id)obj - atIndexPath:(NSIndexPath *)indexPath - delegate:(id )delegate - collectionView:(UICollectionView *)collectionView; +- (void)updateCollectionViewCellWithObject:(nonnull id)obj + atIndexPath:(nonnull NSIndexPath *)indexPath + delegate:(nullable id )delegate + collectionView:(nonnull UICollectionView *)collectionView; @end diff --git a/Pod/Classes/JMActionSheetImagesItem.h b/Pod/Classes/JMActionSheetImagesItem.h index d317813..3266f07 100644 --- a/Pod/Classes/JMActionSheetImagesItem.h +++ b/Pod/Classes/JMActionSheetImagesItem.h @@ -10,7 +10,7 @@ @protocol JMActionSheetImagesItemDisplayable -- (UIImage *)displayableImage; +- (nonnull UIImage *)displayableImage; @end diff --git a/Pod/Classes/JMActionSheetItem.h b/Pod/Classes/JMActionSheetItem.h index ee9039d..4334995 100644 --- a/Pod/Classes/JMActionSheetItem.h +++ b/Pod/Classes/JMActionSheetItem.h @@ -11,7 +11,7 @@ @class JMActionSheetItem; typedef void (^JMActionSheetItemAction)(void); -typedef void (^JMActionSheetSelectedItemBlock)(id selectedItem); +typedef void (^JMActionSheetSelectedItemBlock)(__nonnull id selectedItem); @interface JMActionSheetItem : NSObject @@ -20,10 +20,10 @@ typedef void (^JMActionSheetSelectedItemBlock)(id selectedItem); @property (nonnull, strong, nonatomic) UIImage *icon; //Appearance -@property (strong, nonatomic) UIColor *backgroundColor; -@property (strong, nonatomic) UIColor *textColor; -@property (strong, nonatomic) UIFont *textFont; +@property (nullable, strong, nonatomic) UIColor *backgroundColor; +@property (nullable, strong, nonatomic) UIColor *textColor; +@property (nullable, strong, nonatomic) UIFont *textFont; -+ (NSString *)stringOfClass; ++ (nonnull NSString *)stringOfClass; @end diff --git a/Pod/Classes/JMDatePickerActionSheet.m b/Pod/Classes/JMDatePickerActionSheet.m index 06c45dc..f1d9b7a 100644 --- a/Pod/Classes/JMDatePickerActionSheet.m +++ b/Pod/Classes/JMDatePickerActionSheet.m @@ -42,10 +42,12 @@ + (JMActionSheetDescription *)datePickerDescriptionMinDate:(NSDate *)minDate pickerItem.minDate = minDate; pickerItem.maxDate = maxDate; pickerItem.selectedDate = date; + + __weak JMActionSheetDatePickerItem *weakPickerItem = pickerItem; pickerItem.pickerUpdateActionBlock = ^(id selectedDate) { if (didUpdateBlock) { didUpdateBlock(selectedDate); - pickerItem.selectedDate = selectedDate; + weakPickerItem.selectedDate = selectedDate; } }; pickerItem.pickerValidateActionBlock = didValidateBlock; @@ -55,7 +57,7 @@ + (JMActionSheetDescription *)datePickerDescriptionMinDate:(NSDate *)minDate validateItem.action = ^(){ //NSLog(@"Validate pressed"); if (didValidateBlock) { - didValidateBlock(pickerItem.selectedDate); + didValidateBlock(weakPickerItem.selectedDate); } };