Skip to content

Commit 24eee5a

Browse files
committed
Issue kodecocodes#38 - Changed prefix to use three letters (RWT) as per Apple's 'Programming with Objective-C: Conventions'.
1 parent 070f54c commit 24eee5a

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ UIButton *settingsButton;
188188
UIButton *setBut;
189189
```
190190

191-
A two or three letter prefix should always be used for class names and constants, however may be omitted for Core Data entity names. For any official raywenderlich.com books, starter kits, or tutorials, the prefix 'RW' should be used.
191+
A three letter prefix should always be used for class names and constants, however may be omitted for Core Data entity names. For any official raywenderlich.com books, starter kits, or tutorials, the prefix 'RWT' should be used.
192192

193193
Constants should be camel-case with all words capitalized and prefixed by the related class name for clarity.
194194

@@ -263,7 +263,7 @@ Direct access to instance variables that 'back' properties should be avoided exc
263263
**Preferred:**
264264

265265
```objc
266-
@interface RWTutorial : NSObject
266+
@interface RWTTutorial : NSObject
267267

268268
@property (strong, nonatomic) NSString *tutorialName;
269269

@@ -273,7 +273,7 @@ Direct access to instance variables that 'back' properties should be avoided exc
273273
**Not Preferred:**
274274

275275
```objc
276-
@interface RWTutorial : NSObject {
276+
@interface RWTTutorial : NSObject {
277277
NSString *tutorialName;
278278
}
279279
```
@@ -348,9 +348,9 @@ Constants are preferred over in-line string literals or numbers, as they allow f
348348
**Preferred:**
349349
350350
```objc
351-
static NSString * const RWAboutViewControllerCompanyName = @"RayWenderlich.com";
351+
static NSString * const RWTAboutViewControllerCompanyName = @"RayWenderlich.com";
352352
353-
static CGFloat const RWImageThumbnailHeight = 50.0;
353+
static CGFloat const RWTImageThumbnailHeight = 50.0;
354354
```
355355

356356
**Not Preferred:**
@@ -368,21 +368,21 @@ When using `enum`s, it is recommended to use the new fixed underlying type speci
368368
**For Example:**
369369
370370
```objc
371-
typedef NS_ENUM(NSInteger, RWLeftMenuTopItemType) {
372-
RWLeftMenuTopItemMain,
373-
RWLeftMenuTopItemShows,
374-
RWLeftMenuTopItemSchedule
371+
typedef NS_ENUM(NSInteger, RWTLeftMenuTopItemType) {
372+
RWTLeftMenuTopItemMain,
373+
RWTLeftMenuTopItemShows,
374+
RWTLeftMenuTopItemSchedule
375375
};
376376
```
377377

378378
You can also make explicit value assignments (showing older k-style constant definition):
379379

380380
```objc
381-
typedef NS_ENUM(NSInteger, RWGlobalConstants) {
382-
RWPinSizeMin = 1,
383-
RWPinSizeMax = 5,
384-
RWPinCountMin = 100,
385-
RWPinCountMax = 500,
381+
typedef NS_ENUM(NSInteger, RWTGlobalConstants) {
382+
RWTPinSizeMin = 1,
383+
RWTPinSizeMax = 5,
384+
RWTPinCountMin = 100,
385+
RWTPinCountMax = 500,
386386
};
387387
```
388388
@@ -442,16 +442,16 @@ switch (condition) {
442442
When using an enumerated type for a switch, 'default' is not needed. For example:
443443

444444
```objc
445-
RWLeftMenuTopItemType menuType = RWLeftMenuTopItemMain;
445+
RWTLeftMenuTopItemType menuType = RWTLeftMenuTopItemMain;
446446

447447
switch (menuType) {
448-
case RWLeftMenuTopItemMain:
448+
case RWTLeftMenuTopItemMain:
449449
// ...
450450
break;
451-
case RWLeftMenuTopItemShows:
451+
case RWTLeftMenuTopItemShows:
452452
// ...
453453
break;
454-
case RWLeftMenuTopItemSchedule:
454+
case RWTLeftMenuTopItemSchedule:
455455
// ...
456456
break;
457457
}
@@ -460,12 +460,12 @@ switch (menuType) {
460460

461461
## Private Properties
462462

463-
Private properties should be declared in class extensions (anonymous categories) in the implementation file of a class. Named categories (such as `RWPrivate` or `private`) should never be used unless extending another class. The Anonymous category can be shared/exposed for testing using the <headerfile>+Private.h file naming convention.
463+
Private properties should be declared in class extensions (anonymous categories) in the implementation file of a class. Named categories (such as `RWTPrivate` or `private`) should never be used unless extending another class. The Anonymous category can be shared/exposed for testing using the <headerfile>+Private.h file naming convention.
464464

465465
**For Example:**
466466

467467
```objc
468-
@interface RWDetailViewController ()
468+
@interface RWTDetailViewController ()
469469

470470
@property (strong, nonatomic) GADBannerView *googleAdView;
471471
@property (strong, nonatomic) ADBannerView *iAdView;
@@ -568,7 +568,7 @@ Where class constructor methods are used, these should always return type of 'in
568568

569569
```objc
570570
@interface Airplane
571-
+ (instancetype)airplaneWithType:(RWAirplaneType)type;
571+
+ (instancetype)airplaneWithType:(RWTAirplaneType)type;
572572
@end
573573
```
574574

0 commit comments

Comments
 (0)