Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb16276

Browse files
committed
Make initializer nonnull
1 parent f73d53f commit fb16276

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

RMActionController/Actions/RMAction.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef NS_ENUM(NSInteger, RMActionStyle) {
4545
*
4646
* @return The new instance of RMAction.
4747
*/
48-
+ (nullable instancetype)actionWithTitle:(nonnull NSString *)title style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<T> * __nonnull controller))handler;
48+
+ (nonnull instancetype)actionWithTitle:(nonnull NSString *)title style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<T> * __nonnull controller))handler;
4949

5050
/**
5151
* Returns a new instance of RMAction with the given properties set.
@@ -56,7 +56,7 @@ typedef NS_ENUM(NSInteger, RMActionStyle) {
5656
*
5757
* @return The new instance of RMAction.
5858
*/
59-
+ (nullable instancetype)actionWithImage:(nonnull UIImage *)image style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<T> * __nonnull controller))handler;
59+
+ (nonnull instancetype)actionWithImage:(nonnull UIImage *)image style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<T> * __nonnull controller))handler;
6060

6161
/**
6262
* Returns a new instance of RMAction with the given properties set.
@@ -68,7 +68,7 @@ typedef NS_ENUM(NSInteger, RMActionStyle) {
6868
*
6969
* @return The new instance of RMAction.
7070
*/
71-
+ (nullable instancetype)actionWithTitle:(nonnull NSString *)title image:(nonnull UIImage *)image style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<UIView *> * __nonnull controller))handler;
71+
+ (nonnull instancetype)actionWithTitle:(nonnull NSString *)title image:(nonnull UIImage *)image style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<UIView *> * __nonnull controller))handler;
7272

7373
/// @name Properties
7474
#pragma mark - Properties

RMActionController/Grouping Actions/RMGroupedAction.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ @interface RMGroupedAction ()
2020
@implementation RMGroupedAction
2121

2222
#pragma mark - Class
23-
+ (nullable instancetype)actionWithTitle:(nonnull NSString *)title style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<UIView *> * __nonnull))handler {
23+
+ (instancetype)actionWithTitle:(nonnull NSString *)title style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<UIView *> * __nonnull))handler {
2424
[NSException raise:@"RMIllegalCallException" format:@"Tried to initialize a grouped action with +[%@ %@]. Please use +[%@ %@] instead.", NSStringFromClass(self), NSStringFromSelector(_cmd), NSStringFromClass(self), NSStringFromSelector(@selector(actionWithStyle:andActions:))];
2525
return nil;
2626
}
2727

28-
+ (nullable instancetype)actionWithImage:(nonnull UIImage *)image style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<UIView *> * __nonnull))handler {
28+
+ (instancetype)actionWithImage:(nonnull UIImage *)image style:(RMActionStyle)style andHandler:(nullable void (^)(RMActionController<UIView *> * __nonnull))handler {
2929
[NSException raise:@"RMIllegalCallException" format:@"Tried to initialize a grouped action with +[%@ %@]. Please use +[%@ %@] instead.", NSStringFromClass(self), NSStringFromSelector(_cmd), NSStringFromClass(self), NSStringFromSelector(@selector(actionWithStyle:andActions:))];
3030
return nil;
3131
}

RMActionController/RMActionController.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ typedef NS_ENUM(NSInteger, RMActionControllerStyle) {
6464
*
6565
* @return A new instance of RMActionController.
6666
*/
67-
+ (nullable instancetype)actionControllerWithStyle:(RMActionControllerStyle)style;
67+
+ (nonnull instancetype)actionControllerWithStyle:(RMActionControllerStyle)style;
6868

6969
/**
7070
* Returns a new instance of RMActionController.
@@ -75,7 +75,7 @@ typedef NS_ENUM(NSInteger, RMActionControllerStyle) {
7575
*
7676
* @return A new instance of RMActionController.
7777
*/
78-
+ (nullable instancetype)actionControllerWithStyle:(RMActionControllerStyle)aStyle selectAction:(nullable RMAction<T> *)selectAction andCancelAction:(nullable RMAction<T> *)cancelAction;
78+
+ (nonnull instancetype)actionControllerWithStyle:(RMActionControllerStyle)aStyle selectAction:(nullable RMAction<T> *)selectAction andCancelAction:(nullable RMAction<T> *)cancelAction;
7979

8080
/**
8181
* Returns a new instance of RMActionController.
@@ -88,7 +88,7 @@ typedef NS_ENUM(NSInteger, RMActionControllerStyle) {
8888
*
8989
* @return A new instance of RMActionController.
9090
*/
91-
+ (nullable instancetype)actionControllerWithStyle:(RMActionControllerStyle)aStyle title:(nullable NSString *)aTitle message:(nullable NSString *)aMessage selectAction:(nullable RMAction<T> *)selectAction andCancelAction:(nullable RMAction<T> *)cancelAction;
91+
+ (nonnull instancetype)actionControllerWithStyle:(RMActionControllerStyle)aStyle title:(nullable NSString *)aTitle message:(nullable NSString *)aMessage selectAction:(nullable RMAction<T> *)selectAction andCancelAction:(nullable RMAction<T> *)cancelAction;
9292

9393
/**
9494
* Initializes a new instance of RMActionController.
@@ -103,7 +103,7 @@ typedef NS_ENUM(NSInteger, RMActionControllerStyle) {
103103
*
104104
* @return An initialized of RMActionController.
105105
*/
106-
- (nullable instancetype)initWithStyle:(RMActionControllerStyle)aStyle title:(nullable NSString *)aTitle message:(nullable NSString *)aMessage selectAction:(nullable RMAction<T> *)selectAction andCancelAction:(nullable RMAction<T> *)cancelAction NS_DESIGNATED_INITIALIZER;
106+
- (nonnull instancetype)initWithStyle:(RMActionControllerStyle)aStyle title:(nullable NSString *)aTitle message:(nullable NSString *)aMessage selectAction:(nullable RMAction<T> *)selectAction andCancelAction:(nullable RMAction<T> *)cancelAction NS_DESIGNATED_INITIALIZER;
107107

108108
/// @name User Interface
109109
#pragma mark - User Interface

RMActionController/RMActionController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ @implementation RMActionController
7070
@synthesize disableMotionEffects = _disableMotionEffects;
7171

7272
#pragma mark - Class
73-
+ (nullable instancetype)actionControllerWithStyle:(RMActionControllerStyle)style {
73+
+ (nonnull instancetype)actionControllerWithStyle:(RMActionControllerStyle)style {
7474
return [self actionControllerWithStyle:style selectAction:nil andCancelAction:nil];
7575
}
7676

77-
+ (nullable instancetype)actionControllerWithStyle:(RMActionControllerStyle)style selectAction:(nullable RMAction *)selectAction andCancelAction:(nullable RMAction *)cancelAction {
77+
+ (nonnull instancetype)actionControllerWithStyle:(RMActionControllerStyle)style selectAction:(nullable RMAction *)selectAction andCancelAction:(nullable RMAction *)cancelAction {
7878
return [self actionControllerWithStyle:style title:nil message:nil selectAction:selectAction andCancelAction:cancelAction];
7979
}
8080

81-
+ (nullable instancetype)actionControllerWithStyle:(RMActionControllerStyle)style title:(nullable NSString *)aTitle message:(nullable NSString *)aMessage selectAction:(nullable RMAction *)selectAction andCancelAction:(nullable RMAction *)cancelAction {
81+
+ (nonnull instancetype)actionControllerWithStyle:(RMActionControllerStyle)style title:(nullable NSString *)aTitle message:(nullable NSString *)aMessage selectAction:(nullable RMAction *)selectAction andCancelAction:(nullable RMAction *)cancelAction {
8282
return [[self alloc] initWithStyle:style title:aTitle message:aMessage selectAction:selectAction andCancelAction:cancelAction];
8383
}
8484

0 commit comments

Comments
 (0)