Skip to content

Commit 40a9a2c

Browse files
committed
Merge pull request #728 from ParsePlatform/nlutsenko.initializers
Improve designated initializer flow for all classes with custom initializers.
2 parents 4d01525 + 5eaf898 commit 40a9a2c

File tree

74 files changed

+65
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+65
-160
lines changed

Parse/Internal/Analytics/Controller/PFAnalyticsController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
2727
///--------------------------------------
2828

2929
- (instancetype)init NS_UNAVAILABLE;
30+
+ (instancetype)new NS_UNAVAILABLE;
31+
3032
- (instancetype)initWithDataSource:(id<PFEventuallyQueueProvider>)dataSource NS_DESIGNATED_INITIALIZER;
3133

3234
+ (instancetype)controllerWithDataSource:(id<PFEventuallyQueueProvider>)dataSource;

Parse/Internal/Analytics/Controller/PFAnalyticsController.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ @implementation PFAnalyticsController
2727
#pragma mark - Init
2828
///--------------------------------------
2929

30-
- (instancetype)init {
31-
PFNotDesignatedInitializer();
32-
}
33-
3430
- (instancetype)initWithDataSource:(id<PFEventuallyQueueProvider>)dataSource {
3531
self = [super init];
3632
if (!self) return nil;

Parse/Internal/CloudCode/PFCloudCodeController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
///--------------------------------------
2424

2525
- (instancetype)init NS_UNAVAILABLE;
26+
+ (instancetype)new NS_UNAVAILABLE;
27+
2628
- (instancetype)initWithDataSource:(id<PFCommandRunnerProvider>)dataSource NS_DESIGNATED_INITIALIZER;
2729

2830
+ (instancetype)controllerWithDataSource:(id<PFCommandRunnerProvider>)dataSource;

Parse/Internal/CloudCode/PFCloudCodeController.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ @implementation PFCloudCodeController
2222

2323
///--------------------------------------
2424
#pragma mark - Init
25-
///--------------------------------------
26-
27-
- (instancetype)init {
28-
PFNotDesignatedInitializer();
29-
}
25+
///--------------------------------------s
3026

3127
- (instancetype)initWithDataSource:(id<PFCommandRunnerProvider>)dataSource {
3228
self = [super init];

Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
///--------------------------------------
2727

2828
- (instancetype)init NS_UNAVAILABLE;
29+
+ (instancetype)new NS_UNAVAILABLE;
30+
2931
+ (instancetype)constructorWithDataSource:(id<PFInstallationIdentifierStoreProvider>)dataSource serverURL:(NSURL *)serverURL;
3032

3133
///--------------------------------------

Parse/Internal/Commands/CommandRunner/URLRequestConstructor/PFCommandURLRequestConstructor.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ @implementation PFCommandURLRequestConstructor
2727
#pragma mark - Init
2828
///--------------------------------------
2929

30-
- (instancetype)init {
31-
PFNotDesignatedInitializer();
32-
}
33-
3430
- (instancetype)initWithDataSource:(id<PFInstallationIdentifierStoreProvider>)dataSource serverURL:(NSURL *)serverURL {
3531
self = [super init];
3632
if (!self) return nil;

Parse/Internal/Commands/CommandRunner/URLSession/PFURLSessionCommandRunner.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
1616
@interface PFURLSessionCommandRunner : NSObject <PFCommandRunning>
1717

1818
- (instancetype)init NS_UNAVAILABLE;
19+
+ (instancetype)new NS_UNAVAILABLE;
1920

2021
+ (instancetype)commandRunnerWithDataSource:(id<PFInstallationIdentifierStoreProvider>)dataSource
2122
retryAttempts:(NSUInteger)retryAttempts

Parse/Internal/Commands/CommandRunner/URLSession/PFURLSessionCommandRunner.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ @implementation PFURLSessionCommandRunner
4848
#pragma mark - Init
4949
///--------------------------------------
5050

51-
- (instancetype)init {
52-
PFNotDesignatedInitializer();
53-
}
54-
5551
- (instancetype)initWithDataSource:(id<PFInstallationIdentifierStoreProvider>)dataSource
5652
applicationId:(NSString *)applicationId
5753
clientKey:(NSString *)clientKey

Parse/Internal/Commands/CommandRunner/URLSession/Session/PFURLSession.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
3737
///--------------------------------------
3838

3939
- (instancetype)init NS_UNAVAILABLE;
40+
+ (instancetype)new NS_UNAVAILABLE;
41+
4042
- (instancetype)initWithConfiguration:(NSURLSessionConfiguration *)configuration
4143
delegate:(id<PFURLSessionDelegate>)delegate NS_DESIGNATED_INITIALIZER;
4244

Parse/Internal/Commands/CommandRunner/URLSession/Session/PFURLSession.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ @implementation PFURLSession
3737
#pragma mark - Init
3838
///--------------------------------------
3939

40-
- (instancetype)init {
41-
PFNotDesignatedInitializer();
42-
}
43-
4440
- (instancetype)initWithConfiguration:(NSURLSessionConfiguration *)configuration
4541
delegate:(id<PFURLSessionDelegate>)delegate {
4642
// NOTE: cast to id suppresses warning about designated initializer.

0 commit comments

Comments
 (0)