Skip to content

Commit 6897ead

Browse files
committed
improved code formatting
1 parent be3889b commit 6897ead

29 files changed

+430
-526
lines changed

CollectionViewClassifyMenu.xcodeproj/xcuserdata/chenyilong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
ignoreCount = "0"
5353
continueAfterRunningActions = "No"
5454
filePath = "CollectionViewClassifyMenu/Class/Other/Tool/CYLDBManager.m"
55-
timestampString = "452539886.318811"
55+
timestampString = "473704965.75897"
5656
startingColumnNumber = "9223372036854775807"
5757
endingColumnNumber = "9223372036854775807"
58-
startingLineNumber = "74"
59-
endingLineNumber = "74">
58+
startingLineNumber = "72"
59+
endingLineNumber = "72">
6060
</BreakpointContent>
6161
</BreakpointProxy>
6262
<BreakpointProxy
@@ -66,11 +66,11 @@
6666
ignoreCount = "0"
6767
continueAfterRunningActions = "No"
6868
filePath = "CollectionViewClassifyMenu/Class/Other/Tool/CYLDBManager.m"
69-
timestampString = "452539098.591385"
69+
timestampString = "473704965.75897"
7070
startingColumnNumber = "9223372036854775807"
7171
endingColumnNumber = "9223372036854775807"
72-
startingLineNumber = "50"
73-
endingLineNumber = "50"
72+
startingLineNumber = "48"
73+
endingLineNumber = "48"
7474
landmarkName = "+allTags"
7575
landmarkType = "5">
7676
</BreakpointContent>
@@ -82,11 +82,11 @@
8282
ignoreCount = "0"
8383
continueAfterRunningActions = "No"
8484
filePath = "CollectionViewClassifyMenu/Class/Other/Tool/CYLDBManager.m"
85-
timestampString = "455130251.045142"
85+
timestampString = "473704965.75897"
8686
startingColumnNumber = "9223372036854775807"
8787
endingColumnNumber = "9223372036854775807"
88-
startingLineNumber = "29"
89-
endingLineNumber = "29"
88+
startingLineNumber = "28"
89+
endingLineNumber = "28"
9090
landmarkName = "+dataSource"
9191
landmarkType = "5">
9292
</BreakpointContent>

CollectionViewClassifyMenu/Class/ClassifyMenu/Controller/CYLClassifyMenuViewController.m

Lines changed: 67 additions & 82 deletions
Large diffs are not rendered by default.

CollectionViewClassifyMenu/Class/ClassifyMenu/Controller/CYLMainViewController.m

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,20 @@ @implementation CYLMainViewController
2929
*
3030
* @return filterController
3131
*/
32-
- (CYLMultipleFilterController *)filterController
33-
{
32+
- (CYLMultipleFilterController *)filterController {
3433
if (_filterController == nil) {
3534
_filterController = [[CYLMultipleFilterController alloc] initWithNibName:@"FilterBaseController" bundle:nil];
3635
_filterController.delegate = self;
3736
}
3837
return _filterController;
3938
}
39+
4040
/**
4141
* lazy load _filterParamsTool
4242
*
4343
* @return CYLFilterParamsTool
4444
*/
45-
- (CYLFilterParamsTool *)filterParamsTool
46-
{
45+
- (CYLFilterParamsTool *)filterParamsTool {
4746
if (_filterParamsTool == nil) {
4847
_filterParamsTool = [[CYLFilterParamsTool alloc] init];
4948
_filterParamsTool = [NSKeyedUnarchiver unarchiveObjectWithFile:self.filterParamsTool.filename];
@@ -68,8 +67,7 @@ - (void)initWithRightNavItem {
6867
/**
6968
* 初始化leftNavgationItem
7069
*/
71-
- (void)initLeftBarButtonItem
72-
{
70+
- (void)initLeftBarButtonItem {
7371
self.filterParamsTool = nil;
7472
BOOL shouldShowModified = [self.filterParamsTool.filterParamsDictionary[kMultipleFilterSettingModified] boolValue];
7573
UIImage *image;
@@ -97,17 +95,15 @@ - (void)rightBarButtonClicked:(id)sender {
9795
[self filterControllerDidCompleted:nil];
9896
}
9997

100-
- (void)leftBarButtonClicked:(id)sender
101-
{
98+
- (void)leftBarButtonClicked:(id)sender {
10299
[_filterController refreshFilterParams];
103100
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
104101
[self.filterController showInView:delegate.navigationController.view];
105102
}
106103

107104
#pragma mark - 🔌 FilterControllerDelegate Method
108105

109-
- (void)filterControllerDidCompleted:(FilterBaseController *)controller
110-
{
106+
- (void)filterControllerDidCompleted:(FilterBaseController *)controller {
111107
self.filterParamsTool = nil;
112108
[self initLeftBarButtonItem];
113109
self.filterParamsTool = nil;
@@ -116,11 +112,11 @@ - (void)filterControllerDidCompleted:(FilterBaseController *)controller
116112
NSString *foodMessage = @"🔴不筛选食物";
117113
NSString *area = self.filterParamsTool.filterParamsContentDictionary[@"Hospital"];
118114
id dicValue = area;
119-
if((dicValue) && (dicValue != [NSNull null])) {
120-
areaMessage = [NSString stringWithFormat:@"🔵筛选地区:%@",area];;
115+
if ((dicValue) && (dicValue != [NSNull null])) {
116+
areaMessage = [NSString stringWithFormat:@"🔵筛选地区:%@", area];;
121117
}
122118
NSMutableArray *messageArray = self.filterParamsTool.filterParamsContentDictionary[@"skilled"];
123-
if(self.filterParamsTool.filterParamsContentDictionary[@"skilled"] && self.filterParamsTool.filterParamsContentDictionary[@"skilled"] != [NSNull null]) {
119+
if (self.filterParamsTool.filterParamsContentDictionary[@"skilled"] && self.filterParamsTool.filterParamsContentDictionary[@"skilled"] != [NSNull null]) {
124120
__weak __typeof(messageArray) weakMessageArray = messageArray;
125121
[messageArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
126122
obj = [@"🔴" stringByAppendingString:obj];
@@ -131,7 +127,7 @@ - (void)filterControllerDidCompleted:(FilterBaseController *)controller
131127
foodMessage = skilled;
132128
}
133129
}
134-
message = [NSString stringWithFormat:@"%@\n%@",areaMessage,foodMessage];
130+
message = [NSString stringWithFormat:@"%@\n%@", areaMessage, foodMessage];
135131
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:message delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
136132
[alert show];
137133
NSUInteger delaySeconds = 1;

CollectionViewClassifyMenu/Class/ClassifyMenu/Other/Category/UIButton+CollectionCellStyle.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
@interface UIButton (CollectionCellStyle)
1212

13-
- (void)generalStyle;
14-
- (void)homeStyle;
15-
- (void)redStyle;
13+
- (void)cyl_generalStyle;
14+
- (void)cyl_homeStyle;
15+
- (void)cyl_redStyle;
1616

1717
@end

CollectionViewClassifyMenu/Class/ClassifyMenu/Other/Category/UIButton+CollectionCellStyle.m

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@
22
// UIButton+CollectionCellStyle.m
33
// CollectionViewClassifyMenu
44
//
5-
// Created by https://github.com/ChenYilong on 15/4/2.
5+
// Created by https://github.com/ChenYilong on 15/4 / 2.
66
// Copyright (c) http://weibo.com/luohanchenyilong/ . All rights reserved.
77
//
88

99
#import "UIButton+CollectionCellStyle.h"
1010

1111
@implementation UIButton (CollectionCellStyle)
1212

13-
- (void)generalStyle {
13+
- (void)cyl_generalStyle {
1414
self.layer.cornerRadius = 5.0;
1515
self.backgroundColor = [UIColor whiteColor];
1616
self.layer.borderWidth = 1;
1717
self.layer.masksToBounds = YES;
1818
}
1919

20-
- (void)homeStyle {
20+
- (void)cyl_homeStyle {
2121
self.titleLabel.font = [UIFont systemFontOfSize:15];
22-
[self setTitleColor:[UIColor colorWithRed:18/255.0 green:133/255.0 blue:117/255.0 alpha:1] forState:UIControlStateNormal];
23-
[self setTitleColor:[UIColor colorWithRed:18/255.0 green:133/255.0 blue:117/255.0 alpha:0.7] forState:UIControlStateSelected];
22+
[self setTitleColor:[UIColor colorWithRed:18 / 255.0 green:133 / 255.0 blue:117 / 255.0 alpha:1] forState:UIControlStateNormal];
23+
[self setTitleColor:[UIColor colorWithRed:18 / 255.0 green:133 / 255.0 blue:117 / 255.0 alpha:0.7] forState:UIControlStateSelected];
2424
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
2525

26-
UIImage *imageHighlighted = [[self class] imageWithColor:[UIColor colorWithRed:18/255.0 green:133/255.0 blue:117/255.0 alpha:1]];
26+
UIImage *imageHighlighted = [[self class] cyl_imageWithColor:[UIColor colorWithRed:18 / 255.0 green:133 / 255.0 blue:117 / 255.0 alpha:1]];
2727
[self setBackgroundImage:imageHighlighted forState:UIControlStateHighlighted];
28-
self.layer.borderColor = [UIColor colorWithRed:18/255.0 green:133/255.0 blue:117/255.0 alpha:1].CGColor;
28+
self.layer.borderColor = [UIColor colorWithRed:18 / 255.0 green:133 / 255.0 blue:117 / 255.0 alpha:1].CGColor;
2929
}
3030

31-
- (void)redStyle {
31+
- (void)cyl_redStyle {
3232
self.titleLabel.font = [UIFont systemFontOfSize:15];
33-
[self setTitleColor:[UIColor colorWithRed:160/255.0 green:15/255.0 blue:85/255.0 alpha:1] forState:UIControlStateNormal];
33+
[self setTitleColor:[UIColor colorWithRed:160 / 255.0 green:15 / 255.0 blue:85 / 255.0 alpha:1] forState:UIControlStateNormal];
3434
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
3535

36-
UIImage *imageHighlighted = [[self class] imageWithColor:[UIColor colorWithRed:18/255.0 green:133/255.0 blue:117/255.0 alpha:1]];
36+
UIImage *imageHighlighted = [[self class] cyl_imageWithColor:[UIColor colorWithRed:18 / 255.0 green:133 / 255.0 blue:117 / 255.0 alpha:1]];
3737
[self setBackgroundImage:imageHighlighted forState:UIControlStateHighlighted];
38-
self.layer.borderColor = [UIColor colorWithRed:160/255.0 green:15/255.0 blue:85/255.0 alpha:1].CGColor ;
38+
self.layer.borderColor = [UIColor colorWithRed:160 / 255.0 green:15 / 255.0 blue:85 / 255.0 alpha:1].CGColor ;
3939
}
4040

41-
+ (UIImage *)imageWithColor:(UIColor *)color {
41+
+ (UIImage *)cyl_imageWithColor:(UIColor *)color {
4242
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
4343
UIGraphicsBeginImageContext(rect.size);
4444
CGContextRef context = UIGraphicsGetCurrentContext();
@@ -48,7 +48,6 @@ + (UIImage *)imageWithColor:(UIColor *)color {
4848

4949
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
5050
UIGraphicsEndImageContext();
51-
5251
return image;
5352
}
5453

CollectionViewClassifyMenu/Class/ClassifyMenu/View/CYLFilterHeaderView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@protocol FilterHeaderViewDelegate <NSObject>
1212

1313
@required
14-
-(void)filterHeaderViewMoreBtnClicked:(id)sender;
14+
- (void)filterHeaderViewMoreBtnClicked:(id)sender;
1515

1616
@end
1717

CollectionViewClassifyMenu/Class/ClassifyMenu/View/CYLFilterHeaderView.m

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#import "CYLFilterHeaderView.h"
1010

1111
static float const kTitleButtonWidth = 250.f;
12-
static float const kMoreButtonWidth = 36*2;
12+
static float const kMoreButtonWidth = 36 * 2;
1313
static float const kCureOfLineHight = 0.5;
1414
static float const kCureOfLineOffX = 16;
1515

@@ -21,26 +21,25 @@ @interface CYLFilterHeaderView()
2121

2222
@implementation CYLFilterHeaderView
2323

24-
- (id)initWithFrame:(CGRect)frame
25-
{
24+
- (id)initWithFrame:(CGRect)frame {
2625
self = [super initWithFrame:frame];
2726
if (self) {
2827
self = [self sharedInit];
2928
}
3029
return self;
3130
}
3231

33-
- (id)initWithCoder: (NSCoder *)aDecoder {
34-
self = [super initWithCoder: aDecoder];
32+
- (id)initWithCoder:(NSCoder *)aDecoder {
33+
self = [super initWithCoder:aDecoder];
3534
if (self) {
3635
self = [self sharedInit];
3736
}
3837
return self;
3938
}
4039

4140
- (id)sharedInit {
42-
UIView *cureOfLine = [[UIView alloc] initWithFrame:CGRectMake(kCureOfLineOffX, CYLFilterHeaderViewHeigt-kCureOfLineHight, [UIScreen mainScreen].bounds.size.width - 2*kCureOfLineOffX, kCureOfLineHight)];
43-
cureOfLine.backgroundColor = [UIColor colorWithRed:188.0/255.0 green:188.0/255.0 blue:188.0/255.0 alpha:1.0];
41+
UIView *cureOfLine = [[UIView alloc] initWithFrame:CGRectMake(kCureOfLineOffX, CYLFilterHeaderViewHeigt-kCureOfLineHight, [UIScreen mainScreen].bounds.size.width - 2 * kCureOfLineOffX, kCureOfLineHight)];
42+
cureOfLine.backgroundColor = [UIColor colorWithRed:188.0 / 255.0 green:188.0 / 255.0 blue:188.0 / 255.0 alpha:1.0];
4443
[self addSubview:cureOfLine];
4544
self.backgroundColor = [UIColor whiteColor];
4645
//仅修改self.titleButton的宽度,xyh值不变

CollectionViewClassifyMenu/Class/ClassifyMenu/View/CYLIndexPathButton.m

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

1111
@implementation CYLIndexPathButton
1212

13-
/**
14-
* 重写高亮状态,让高亮状态不改变样式
15-
*
16-
*/
17-
//-(void)setHighlighted:(BOOL)highlighted {}
18-
1913
@end

CollectionViewClassifyMenu/Class/ClassifyMenu/View/CYLRightImageButton.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@
1111

1212
@implementation CYLRightImageButton
1313

14-
- (id)initWithFrame:(CGRect)frame
15-
{
14+
- (id)initWithFrame:(CGRect)frame {
1615
self = [super initWithFrame:frame];
1716
if (self) {
1817
self = [self sharedInit];
1918
}
2019
return self;
2120
}
2221

23-
- (id)initWithCoder: (NSCoder *)aDecoder {
24-
self = [super initWithCoder: aDecoder];
22+
- (id)initWithCoder:(NSCoder *)aDecoder {
23+
self = [super initWithCoder:aDecoder];
2524
if (self) {
2625
self = [self sharedInit];
2726
}
@@ -42,6 +41,6 @@ - (id)sharedInit {
4241
return self;
4342
}
4443

45-
-(void)setHighlighted:(BOOL)highlighted {}
44+
- (void)setHighlighted:(BOOL)highlighted {}
4645

4746
@end

0 commit comments

Comments
 (0)