Skip to content

Commit 16199c1

Browse files
committed
Added nullable annotations.
1 parent 3c1aafb commit 16199c1

File tree

12 files changed

+87
-15
lines changed

12 files changed

+87
-15
lines changed

STNetTaskQueue.xcodeproj/project.pbxproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
76012C4C1C265A160090BE94 /* Project object */ = {
151151
isa = PBXProject;
152152
attributes = {
153-
LastUpgradeCheck = 0720;
153+
LastUpgradeCheck = 0800;
154154
ORGANIZATIONNAME = Sth4Me;
155155
TargetAttributes = {
156156
76012C541C265A160090BE94 = {
@@ -217,8 +217,10 @@
217217
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
218218
CLANG_WARN_EMPTY_BODY = YES;
219219
CLANG_WARN_ENUM_CONVERSION = YES;
220+
CLANG_WARN_INFINITE_RECURSION = YES;
220221
CLANG_WARN_INT_CONVERSION = YES;
221222
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
223+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
222224
CLANG_WARN_UNREACHABLE_CODE = YES;
223225
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
224226
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -264,8 +266,10 @@
264266
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
265267
CLANG_WARN_EMPTY_BODY = YES;
266268
CLANG_WARN_ENUM_CONVERSION = YES;
269+
CLANG_WARN_INFINITE_RECURSION = YES;
267270
CLANG_WARN_INT_CONVERSION = YES;
268271
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
272+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
269273
CLANG_WARN_UNREACHABLE_CODE = YES;
270274
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
271275
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -295,6 +299,7 @@
295299
76012C5E1C265A160090BE94 /* Debug */ = {
296300
isa = XCBuildConfiguration;
297301
buildSettings = {
302+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
298303
DEFINES_MODULE = YES;
299304
DYLIB_COMPATIBILITY_VERSION = 1;
300305
DYLIB_CURRENT_VERSION = 1;
@@ -312,6 +317,7 @@
312317
76012C5F1C265A160090BE94 /* Release */ = {
313318
isa = XCBuildConfiguration;
314319
buildSettings = {
320+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
315321
DEFINES_MODULE = YES;
316322
DYLIB_COMPATIBILITY_VERSION = 1;
317323
DYLIB_CURRENT_VERSION = 1;

STNetTaskQueue.xcodeproj/xcshareddata/xcschemes/STNetTaskQueue.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0720"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

STNetTaskQueue/STHTTPNetTask.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import <STNetTaskQueue/STNetTask.h>
1010

11+
NS_ASSUME_NONNULL_BEGIN
12+
1113
// Error domains
1214
FOUNDATION_EXPORT NSString *const STHTTPNetTaskServerError;
1315
FOUNDATION_EXPORT NSString *const STHTTPNetTaskResponseParsedError;
@@ -79,7 +81,7 @@ typedef NS_ENUM(NSUInteger, STHTTPNetTaskResponseType) {
7981
@param value id Value to be transformed
8082
@return id The transformed value. Should return the same value if "value" is not supposed to be transformed.
8183
*/
82-
- (id)transformValue:(id)value;
84+
- (nullable id)transformValue:(id)value;
8385

8486
/**
8587
Separator string which should be used when packing parameters.
@@ -88,7 +90,7 @@ typedef NS_ENUM(NSUInteger, STHTTPNetTaskResponseType) {
8890
8991
@return NSString
9092
*/
91-
- (NSString *)parameterNameSeparator;
93+
- (nullable NSString *)parameterNameSeparator;
9294

9395
@end
9496

@@ -179,3 +181,5 @@ typedef NS_ENUM(NSUInteger, STHTTPNetTaskResponseType) {
179181
- (void)didResponseData:(NSData *)data;
180182

181183
@end
184+
185+
NS_ASSUME_NONNULL_END

STNetTaskQueue/STHTTPNetTaskParametersPacker.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import <Foundation/Foundation.h>
1010

11+
NS_ASSUME_NONNULL_BEGIN
12+
1113
@class STHTTPNetTask;
1214

1315
@interface STHTTPNetTaskParametersPacker : NSObject
@@ -16,3 +18,5 @@
1618
- (NSDictionary<NSString *, id> *)pack;
1719

1820
@end
21+
22+
NS_ASSUME_NONNULL_END

STNetTaskQueue/STHTTPNetTaskQueueHandler.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import <STNetTaskQueue/STNetTaskQueue.h>
1010

11+
NS_ASSUME_NONNULL_BEGIN
12+
1113
@interface STHTTPNetTaskQueueHandler : NSObject<STNetTaskQueueHandler>
1214

1315
/**
@@ -16,13 +18,15 @@
1618
1719
@param baseURL NSURL
1820
*/
19-
- (instancetype)initWithBaseURL:(NSURL *)baseURL;
21+
- (instancetype)initWithBaseURL:(nullable NSURL *)baseURL;
2022

2123
/**
2224
Init the handler with baseURL and NSURLSessionConfiguration.
2325
2426
@param baseURL NSURL
2527
*/
26-
- (instancetype)initWithBaseURL:(NSURL *)baseURL configuration:(NSURLSessionConfiguration *)configuration;
28+
- (instancetype)initWithBaseURL:(nullable NSURL *)baseURL configuration:(NSURLSessionConfiguration *)configuration;
2729

2830
@end
31+
32+
NS_ASSUME_NONNULL_END

STNetTaskQueue/STNetTask.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import <Foundation/Foundation.h>
1010

11+
NS_ASSUME_NONNULL_BEGIN
12+
1113
FOUNDATION_EXPORT NSString *const STNetTaskUnknownError;
1214

1315
#ifdef RACObserve
@@ -138,3 +140,5 @@ typedef void (^STNetTaskSubscriptionBlock)();
138140
- (void)subscribeState:(STNetTaskState)state usingBlock:(STNetTaskSubscriptionBlock)block;
139141

140142
@end
143+
144+
NS_ASSUME_NONNULL_END

STNetTaskQueue/STNetTaskChain.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import <Foundation/Foundation.h>
1010

11+
NS_ASSUME_NONNULL_BEGIN
12+
1113
@class STNetTaskQueue;
1214
@class STNetTask;
1315
@class STNetTaskChain;
@@ -22,9 +24,9 @@ DEPRECATED_MSG_ATTRIBUTE("Use STNetTaskGroup instead")
2224
DEPRECATED_MSG_ATTRIBUTE("Use STNetTaskGroup instead")
2325
@interface STNetTaskChain : NSObject
2426

25-
@property (nonatomic, weak) id<STNetTaskChainDelegate> delegate;
26-
@property (nonatomic, strong) STNetTaskQueue *queue;
27-
@property (nonatomic, strong, readonly) NSError *error;
27+
@property (nullable, nonatomic, weak) id<STNetTaskChainDelegate> delegate;
28+
@property (nullable, nonatomic, strong) STNetTaskQueue *queue;
29+
@property (nullable, nonatomic, strong, readonly) NSError *error;
2830
@property (nonatomic, assign, readonly) BOOL started;
2931

3032
- (void)setTasks:(STNetTask *)task, ...;
@@ -35,3 +37,5 @@ DEPRECATED_MSG_ATTRIBUTE("Use STNetTaskGroup instead")
3537
- (void)cancel;
3638

3739
@end
40+
41+
NS_ASSUME_NONNULL_END

STNetTaskQueue/STNetTaskGroup.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import <Foundation/Foundation.h>
1010

11+
NS_ASSUME_NONNULL_BEGIN
12+
1113
@class STNetTask;
1214
@class STNetTaskQueue;
1315
@class STNetTaskGroup;
@@ -26,7 +28,7 @@ typedef NS_ENUM(NSUInteger, STNetTaskGroupState) {
2628
@param group STNetTaskGroup
2729
@param error NSError the first error was encountered in the group.
2830
*/
29-
typedef void (^STNetTaskGroupSubscriptionBlock)(STNetTaskGroup *group, NSError *error);
31+
typedef void (^STNetTaskGroupSubscriptionBlock)(STNetTaskGroup *group, NSError * _Nullable error);
3032

3133
/**
3234
STNetTaskGroup is a group to execute STNetTasks in serial or concurrent mode.
@@ -38,7 +40,7 @@ typedef void (^STNetTaskGroupSubscriptionBlock)(STNetTaskGroup *group, NSError *
3840
The executing task in the group when it is in STNetTaskGroupModeSerial.
3941
It will be always 'nil' when the group is in STNetTaskGroupModeConcurrent.
4042
*/
41-
@property (nonatomic, strong, readonly) STNetTask *executingTask;
43+
@property (nullable, nonatomic, strong, readonly) STNetTask *executingTask;
4244

4345
/**
4446
All tasks in this group.
@@ -113,3 +115,5 @@ typedef void (^STNetTaskGroupSubscriptionBlock)(STNetTaskGroup *group, NSError *
113115
- (STNetTaskGroup *)concurrentNetTaskGroupInQueue:(STNetTaskQueue *)queue;
114116

115117
@end
118+
119+
NS_ASSUME_NONNULL_END

STNetTaskQueue/STNetTaskQueue.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import <Foundation/Foundation.h>
1010

11+
NS_ASSUME_NONNULL_BEGIN
12+
1113
@class STNetTask;
1214
@protocol STNetTaskDelegate;
1315

@@ -52,7 +54,7 @@ FOUNDATION_EXPORT const unsigned char STNetTaskQueueVersionString[];
5254
/**
5355
The STNetTaskQueueHandler which is used for handling the net tasks in queue.
5456
*/
55-
@property (nonatomic, strong) id<STNetTaskQueueHandler> handler;
57+
@property (nullable, nonatomic, strong) id<STNetTaskQueueHandler> handler;
5658

5759
/**
5860
Count of Max concurrent task in a queue.
@@ -131,7 +133,9 @@ FOUNDATION_EXPORT const unsigned char STNetTaskQueueVersionString[];
131133

132134
@end
133135

136+
NS_ASSUME_NONNULL_END
137+
134138
#import <STNetTaskQueue/STNetTaskChain.h>
135139
#import <STNetTaskQueue/STNetTaskGroup.h>
136140
#import <STNetTaskQueue/STHTTPNetTask.h>
137-
#import <STNetTaskQueue/STHTTPNetTaskQueueHandler.h>
141+
#import <STNetTaskQueue/STHTTPNetTaskQueueHandler.h>

STNetTaskQueue/STNetTaskQueueLog.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88

99
#import <Foundation/Foundation.h>
1010

11+
NS_ASSUME_NONNULL_BEGIN
12+
1113
@interface STNetTaskQueueLog : NSObject
1214

1315
+ (void)log:(NSString *)content, ...;
1416

1517
@end
18+
19+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)