Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Missing Nullability Annotations #98

Merged
merged 3 commits into from
Jan 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Pod/Classes/ios/NYTPhotoCaptionView.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

@import UIKit;

NS_ASSUME_NONNULL_BEGIN

/**
* The left and right margin around the content.
*/
Expand All @@ -27,6 +29,8 @@ extern const CGFloat NYTPhotoCaptionViewHorizontalMargin;
*
* @return A fully initialized object.
*/
- (instancetype)initWithAttributedTitle:(NSAttributedString *)attributedTitle attributedSummary:(NSAttributedString *)attributedSummary attributedCredit:(NSAttributedString *)attributedCredit NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithAttributedTitle:(nullable NSAttributedString *)attributedTitle attributedSummary:(nullable NSAttributedString *)attributedSummary attributedCredit:(nullable NSAttributedString *)attributedCredit NS_DESIGNATED_INITIALIZER;

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion Pod/Classes/ios/NYTPhotoDismissalInteractionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

@import UIKit;

NS_ASSUME_NONNULL_BEGIN

/**
* An object that controls an interactive photo dismissal transition.
*/
Expand All @@ -21,7 +23,7 @@
/**
* If set, this view will be hidden as soon as the interactive transition starts, and shown after it ends.
*/
@property (nonatomic) UIView *viewToHideWhenBeginningTransition;
@property (nonatomic, nullable) UIView *viewToHideWhenBeginningTransition;

/**
* A `BOOL` determining whether, after reaching a certain panning threshold that constitutes a dismissal, the animator object should be used to finish the transition.
Expand All @@ -38,3 +40,5 @@
- (void)didPanWithPanGestureRecognizer:(UIPanGestureRecognizer *)panGestureRecognizer viewToPan:(UIView *)viewToPan anchorPoint:(CGPoint)anchorPoint;

@end

NS_ASSUME_NONNULL_END
10 changes: 7 additions & 3 deletions Pod/Classes/ios/NYTPhotoTransitionAnimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

@import UIKit;

NS_ASSUME_NONNULL_BEGIN

/**
* An object that controls the animated transition of photo presentation and dismissal.
*/
Expand All @@ -26,12 +28,12 @@
/**
* The view that is used for animating the starting view. If no view is set, the starting view is screenshotted and the relevant properties are copied to the new view.
*/
@property (nonatomic) UIView *startingViewForAnimation;
@property (nonatomic, nullable) UIView *startingViewForAnimation;

/**
* The view that is used for animating the ending view. If no view is set, the ending view is screenshotted and relevant properties copied to the new view.
*/
@property (nonatomic) UIView *endingViewForAnimation;
@property (nonatomic, nullable) UIView *endingViewForAnimation;

/**
* Whether this transition is a dismissal. If `NO`, presentation is assumed.
Expand Down Expand Up @@ -75,6 +77,8 @@
*
* @return A new view identical in appearance to the passed-in view, with relevant properties transferred. Not a member of any view hierarchy. Return `nil` if the passed-in view is `nil`.
*/
+ (UIView *)newAnimationViewFromView:(UIView *)view;
+ (nullable UIView *)newAnimationViewFromView:(nullable UIView *)view;

@end

NS_ASSUME_NONNULL_END
4 changes: 4 additions & 0 deletions Pod/Classes/ios/NYTPhotoTransitionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

@import UIKit;

NS_ASSUME_NONNULL_BEGIN

/**
* An object that manages both animated transitions and interactive transitions, acting as the transitioning delegate and internally coordinating multiple objects that do the animating and interactivity work.
*/
Expand Down Expand Up @@ -38,3 +40,5 @@
- (void)didPanWithPanGestureRecognizer:(UIPanGestureRecognizer *)panGestureRecognizer viewToPan:(UIView *)viewToPan anchorPoint:(CGPoint)anchorPoint;

@end

NS_ASSUME_NONNULL_END
10 changes: 7 additions & 3 deletions Pod/Classes/ios/NYTPhotoViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
@protocol NYTPhoto;
@protocol NYTPhotoViewControllerDelegate;

NS_ASSUME_NONNULL_BEGIN

/**
* `NYTPhotoViewController` observes this notification. It expects an `id <NYTPhoto>` object as the object of the notification.
*/
Expand All @@ -32,7 +34,7 @@ extern NSString * const NYTPhotoViewControllerPhotoImageUpdatedNotification;
/**
* The internal activity view shown while the image is loading. Set from the initializer.
*/
@property (nonatomic, readonly) UIView *loadingView;
@property (nonatomic, readonly, nullable) UIView *loadingView;

/**
* The gesture recognizer used to detect the double tap gesture used for zooming on photos.
Expand All @@ -42,7 +44,7 @@ extern NSString * const NYTPhotoViewControllerPhotoImageUpdatedNotification;
/**
* The object that acts as the photo view controller's delegate.
*/
@property (nonatomic, weak) id <NYTPhotoViewControllerDelegate> delegate;
@property (nonatomic, weak, nullable) id <NYTPhotoViewControllerDelegate> delegate;

/**
* The designated initializer that takes the photo and activity view.
Expand All @@ -53,7 +55,7 @@ extern NSString * const NYTPhotoViewControllerPhotoImageUpdatedNotification;
*
* @return A fully initialized object.
*/
- (instancetype)initWithPhoto:(id <NYTPhoto>)photo loadingView:(UIView *)loadingView notificationCenter:(NSNotificationCenter *)notificationCenter NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithPhoto:(nullable id <NYTPhoto>)photo loadingView:(nullable UIView *)loadingView notificationCenter:(nullable NSNotificationCenter *)notificationCenter NS_DESIGNATED_INITIALIZER;

@end

Expand All @@ -70,3 +72,5 @@ extern NSString * const NYTPhotoViewControllerPhotoImageUpdatedNotification;
- (void)photoViewController:(NYTPhotoViewController *)photoViewController didLongPressWithGestureRecognizer:(UILongPressGestureRecognizer *)longPressGestureRecognizer;

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion Pod/Classes/ios/NYTPhotosDataSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#import "NYTPhotosViewControllerDataSource.h"

NS_ASSUME_NONNULL_BEGIN

/**
* A concrete implementation of the `NYTPhotosViewControllerDataSource`.
*/
Expand All @@ -22,6 +24,8 @@
*
* @return A fully initialized object.
*/
- (instancetype)initWithPhotos:(NSArray *)photos NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithPhotos:(nullable NSArray *)photos NS_DESIGNATED_INITIALIZER;

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion Pod/Classes/ios/NYTScalingImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
@class FLAnimatedImageView;
#endif

NS_ASSUME_NONNULL_BEGIN

@interface NYTScalingImageView : UIScrollView

/**
Expand All @@ -31,7 +33,7 @@
*
* @return A fully initialized object.
*/
- (instancetype)initWithImageData:(NSData *)image frame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithImageData:(nullable NSData *)image frame:(CGRect)frame NS_DESIGNATED_INITIALIZER;

/**
* Updates the image in the image view and centers and zooms the new image.
Expand All @@ -46,3 +48,5 @@
- (void)centerScrollViewContents;

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion Pod/Classes/ios/Protocols/NYTPhoto.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

@import UIKit;

NS_ASSUME_NONNULL_BEGIN

/**
* The model for photos displayed in an `NYTPhotosViewController`.
*/
Expand All @@ -22,7 +24,7 @@
* The image data to display. This will be preferred over the `image` property.
* In case this is empty `image` will be used. The main advantage of using this is animated gif support.
*/
@property (nonatomic, readonly) NSData *imageData;
@property (nonatomic, readonly, nullable) NSData *imageData;

/**
* A placeholder image for display while the image is loading.
Expand All @@ -45,3 +47,5 @@
@property (nonatomic, readonly, nullable) NSAttributedString *attributedCaptionCredit;

@end

NS_ASSUME_NONNULL_END
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is imageData non-null while the rest are nullable?