Skip to content

Commit 43c21be

Browse files
committed
Added NS_DESIGNATED_INITIALIZER annotations to the designated initializers for each class.
1 parent 453c3d2 commit 43c21be

40 files changed

Lines changed: 185 additions & 93 deletions

‎framework/Source/CPTAxisLabel.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
/// @name Initialization
1515
/// @{
1616
-(instancetype)initWithText:(NSString *)newText textStyle:(CPTTextStyle *)style;
17-
-(instancetype)initWithContentLayer:(CPTLayer *)layer;
17+
-(instancetype)initWithContentLayer:(CPTLayer *)layer NS_DESIGNATED_INITIALIZER;
18+
-(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER;
1819
/// @}
1920

2021
/// @name Layout

‎framework/Source/CPTAxisLabel.m‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ -(void)encodeWithCoder:(NSCoder *)coder
9292
[coder encodeDecimal:self.tickLocation forKey:@"CPTAxisLabel.tickLocation"];
9393
}
9494

95+
/// @endcond
96+
97+
/** @brief Returns an object initialized from data in a given unarchiver.
98+
* @param coder An unarchiver object.
99+
* @return An object initialized from data in a given unarchiver.
100+
*/
95101
-(instancetype)initWithCoder:(NSCoder *)coder
96102
{
97103
if ( (self = [super init]) ) {
@@ -104,8 +110,6 @@ -(instancetype)initWithCoder:(NSCoder *)coder
104110
return self;
105111
}
106112

107-
/// @endcond
108-
109113
#pragma mark -
110114
#pragma mark Layout
111115

‎framework/Source/CPTCalendarFormatter.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
/// @name Initialization
99
/// @{
10-
-(instancetype)initWithDateFormatter:(NSDateFormatter *)aDateFormatter;
10+
-(instancetype)initWithDateFormatter:(NSDateFormatter *)aDateFormatter NS_DESIGNATED_INITIALIZER;
11+
-(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER;
1112
/// @}
1213

1314
@end

‎framework/Source/CPTCalendarFormatter.m‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ -(void)encodeWithCoder:(NSCoder *)coder
9191
[coder encodeInteger:(NSInteger)self.referenceCalendarUnit forKey:@"CPTCalendarFormatter.referenceCalendarUnit"];
9292
}
9393

94+
/// @endcond
95+
96+
/** @brief Returns an object initialized from data in a given unarchiver.
97+
* @param coder An unarchiver object.
98+
* @return An object initialized from data in a given unarchiver.
99+
*/
94100
-(instancetype)initWithCoder:(NSCoder *)coder
95101
{
96102
if ( (self = [super initWithCoder:coder]) ) {
@@ -102,8 +108,6 @@ -(instancetype)initWithCoder:(NSCoder *)coder
102108
return self;
103109
}
104110

105-
/// @endcond
106-
107111
#pragma mark -
108112
#pragma mark NSCopying Methods
109113

‎framework/Source/CPTColor.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828

2929
/// @name Initialization
3030
/// @{
31-
-(instancetype)initWithCGColor:(CGColorRef)cgColor;
31+
-(instancetype)initWithCGColor:(CGColorRef)cgColor NS_DESIGNATED_INITIALIZER;
3232
-(instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
33+
-(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER;
3334

3435
-(instancetype)colorWithAlphaComponent:(CGFloat)alpha;
3536
/// @}

‎framework/Source/CPTColor.m‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,12 @@ -(void)encodeWithCoder:(NSCoder *)coder
412412
}
413413
}
414414

415+
/// @endcond
416+
417+
/** @brief Returns an object initialized from data in a given unarchiver.
418+
* @param coder An unarchiver object.
419+
* @return An object initialized from data in a given unarchiver.
420+
*/
415421
-(instancetype)initWithCoder:(NSCoder *)coder
416422
{
417423
if ( (self = [super init]) ) {
@@ -433,8 +439,6 @@ -(instancetype)initWithCoder:(NSCoder *)coder
433439
return self;
434440
}
435441

436-
/// @endcond
437-
438442
#pragma mark -
439443
#pragma mark NSCopying Methods
440444

‎framework/Source/CPTColorSpace.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
/// @name Initialization
1111
/// @{
12-
-(instancetype)initWithCGColorSpace:(CGColorSpaceRef)colorSpace;
12+
-(instancetype)initWithCGColorSpace:(CGColorSpaceRef)colorSpace NS_DESIGNATED_INITIALIZER;
13+
-(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER;
1314
/// @}
1415

1516
@end

‎framework/Source/CPTColorSpace.m‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ -(void)encodeWithCoder:(NSCoder *)coder
8181
[coder encodeCGColorSpace:self.cgColorSpace forKey:@"CPTColorSpace.cgColorSpace"];
8282
}
8383

84+
/// @endcond
85+
86+
/** @brief Returns an object initialized from data in a given unarchiver.
87+
* @param coder An unarchiver object.
88+
* @return An object initialized from data in a given unarchiver.
89+
*/
8490
-(instancetype)initWithCoder:(NSCoder *)coder
8591
{
8692
if ( (self = [super init]) ) {
@@ -89,6 +95,4 @@ -(instancetype)initWithCoder:(NSCoder *)coder
8995
return self;
9096
}
9197

92-
/// @endcond
93-
9498
@end

‎framework/Source/CPTConstraints.m‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ -(instancetype)initWithCoder:(NSCoder *)coder
124124
return [self initWithRelativeOffset:offset];
125125
}
126126

127-
return self;
127+
return nil;
128128
}
129129

130130
/// @endcond

‎framework/Source/CPTFill.m‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ -(instancetype)initWithCoder:(NSCoder *)coder
109109
return [self initWithColor:fill];
110110
}
111111

112-
fill = [coder decodeObjectForKey:@"_CPTFillGradient.fillGradient"];
113-
if ( fill ) {
114-
return [self initWithGradient:fill];
112+
id gradient = [coder decodeObjectForKey:@"_CPTFillGradient.fillGradient"];
113+
if ( gradient ) {
114+
return [self initWithGradient:gradient];
115115
}
116116

117-
fill = [coder decodeObjectForKey:@"_CPTFillImage.fillImage"];
118-
if ( fill ) {
119-
return [self initWithImage:fill];
117+
id image = [coder decodeObjectForKey:@"_CPTFillImage.fillImage"];
118+
if ( image ) {
119+
return [self initWithImage:image];
120120
}
121121

122-
return self;
122+
return nil;
123123
}
124124

125125
/// @endcond

0 commit comments

Comments
 (0)