1. 程式人生 > >iOS開發程式碼規範(通用)

iOS開發程式碼規範(通用)

 1      #pragma mark - private methods
 2 
 3   - (void)samplePrivateMethod
 4   {...}
 5 
 6   - (void)sampleForIf
 7   {...}
 8 
 9   - (void)sampleForWhile
10   {...}
11   
12   - (void)sampleForSwitch
13   {...}
14 
15   - (void)wrongExamples
16   {...}
17 
18   #pragma mark - public methods
19
  - (void)samplePublicMethodWithParam:(NSString*)sampleParam 20   {...} 21 22   #pragma mark - life cycle methods 23   - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 24   {...} 25 26   - (void)viewDidLoad 27   {...} 28 29   - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
30   {...}