Skip to content

Commit a6f879c

Browse files
committed
Cell
1 parent 60f8d4d commit a6f879c

33 files changed

Lines changed: 1049 additions & 72 deletions

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,16 @@
9898
4E4D6A821B1C6D5F00FD2E49 /* FilesChangeIntroduceCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A811B1C6D5F00FD2E49 /* FilesChangeIntroduceCell.m */; };
9999
4E4D6A851B1C6D8200FD2E49 /* FileChangeListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A841B1C6D8200FD2E49 /* FileChangeListCell.m */; };
100100
4E4D6A881B1C6E1B00FD2E49 /* MRPRAcceptEditCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A871B1C6E1B00FD2E49 /* MRPRAcceptEditCell.m */; };
101-
4E4D6A8B1B1C6E3100FD2E49 /* MRPRAcceptCheckCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A8A1B1C6E3000FD2E49 /* MRPRAcceptCheckCell.m */; };
101+
4E4D6A8B1B1C6E3100FD2E49 /* TextCheckMarkCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A8A1B1C6E3000FD2E49 /* TextCheckMarkCell.m */; };
102102
4E4D6A8E1B1D5B9A00FD2E49 /* MRPRBaseInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A8D1B1D5B9A00FD2E49 /* MRPRBaseInfo.m */; };
103103
4E4D6A911B1D84B400FD2E49 /* FileChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A901B1D84B400FD2E49 /* FileChange.m */; };
104104
4E4D6A941B1D851E00FD2E49 /* FileChanges.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A931B1D851E00FD2E49 /* FileChanges.m */; };
105105
4E4D6A9A1B1D893500FD2E49 /* CommitInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A991B1D893500FD2E49 /* CommitInfo.m */; };
106106
4E4D6A9D1B1D898800FD2E49 /* CommitComment.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A9C1B1D898800FD2E49 /* CommitComment.m */; };
107107
4E4D6AA01B1D89D400FD2E49 /* CommitDetail.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6A9F1B1D89D400FD2E49 /* CommitDetail.m */; };
108108
4E4D6AA31B1DB63A00FD2E49 /* FileLineChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6AA21B1DB63A00FD2E49 /* FileLineChange.m */; };
109+
4E4D6AA61B1DBA3A00FD2E49 /* MRPRDisclosureCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6AA51B1DBA3A00FD2E49 /* MRPRDisclosureCell.m */; };
110+
4E4D6AAC1B1EED6A00FD2E49 /* AddCommentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4D6AAB1B1EED6A00FD2E49 /* AddCommentCell.m */; };
109111
4E53EB521AFA03990034FE1C /* RKSwipeBetweenViewControllers.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E53EB511AFA03990034FE1C /* RKSwipeBetweenViewControllers.m */; };
110112
4E53EB591AFB090E0034FE1C /* nav_page_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E53EB571AFB090E0034FE1C /* nav_page_selected@2x.png */; };
111113
4E53EB5A1AFB090E0034FE1C /* nav_page_unselected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E53EB581AFB090E0034FE1C /* nav_page_unselected@2x.png */; };
@@ -828,8 +830,8 @@
828830
4E4D6A841B1C6D8200FD2E49 /* FileChangeListCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileChangeListCell.m; sourceTree = "<group>"; };
829831
4E4D6A861B1C6E1A00FD2E49 /* MRPRAcceptEditCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRPRAcceptEditCell.h; sourceTree = "<group>"; };
830832
4E4D6A871B1C6E1B00FD2E49 /* MRPRAcceptEditCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRPRAcceptEditCell.m; sourceTree = "<group>"; };
831-
4E4D6A891B1C6E3000FD2E49 /* MRPRAcceptCheckCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRPRAcceptCheckCell.h; sourceTree = "<group>"; };
832-
4E4D6A8A1B1C6E3000FD2E49 /* MRPRAcceptCheckCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRPRAcceptCheckCell.m; sourceTree = "<group>"; };
833+
4E4D6A891B1C6E3000FD2E49 /* TextCheckMarkCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckMarkCell.h; sourceTree = "<group>"; };
834+
4E4D6A8A1B1C6E3000FD2E49 /* TextCheckMarkCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextCheckMarkCell.m; sourceTree = "<group>"; };
833835
4E4D6A8C1B1D5B9A00FD2E49 /* MRPRBaseInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRPRBaseInfo.h; sourceTree = "<group>"; };
834836
4E4D6A8D1B1D5B9A00FD2E49 /* MRPRBaseInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRPRBaseInfo.m; sourceTree = "<group>"; };
835837
4E4D6A8F1B1D84B400FD2E49 /* FileChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileChange.h; sourceTree = "<group>"; };
@@ -844,6 +846,10 @@
844846
4E4D6A9F1B1D89D400FD2E49 /* CommitDetail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommitDetail.m; sourceTree = "<group>"; };
845847
4E4D6AA11B1DB63A00FD2E49 /* FileLineChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileLineChange.h; sourceTree = "<group>"; };
846848
4E4D6AA21B1DB63A00FD2E49 /* FileLineChange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileLineChange.m; sourceTree = "<group>"; };
849+
4E4D6AA41B1DBA3A00FD2E49 /* MRPRDisclosureCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRPRDisclosureCell.h; sourceTree = "<group>"; };
850+
4E4D6AA51B1DBA3A00FD2E49 /* MRPRDisclosureCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRPRDisclosureCell.m; sourceTree = "<group>"; };
851+
4E4D6AAA1B1EED6A00FD2E49 /* AddCommentCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddCommentCell.h; sourceTree = "<group>"; };
852+
4E4D6AAB1B1EED6A00FD2E49 /* AddCommentCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddCommentCell.m; sourceTree = "<group>"; };
847853
4E53EB501AFA03990034FE1C /* RKSwipeBetweenViewControllers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKSwipeBetweenViewControllers.h; sourceTree = "<group>"; };
848854
4E53EB511AFA03990034FE1C /* RKSwipeBetweenViewControllers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKSwipeBetweenViewControllers.m; sourceTree = "<group>"; };
849855
4E53EB571AFB090E0034FE1C /* nav_page_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "nav_page_selected@2x.png"; sourceTree = "<group>"; };
@@ -3407,12 +3413,14 @@
34073413
4ECF702B1B1704C5000280FF /* NProjectItemCell.m */,
34083414
4ECF704A1B1876CB000280FF /* MRPRListCell.h */,
34093415
4ECF704B1B1876CB000280FF /* MRPRListCell.m */,
3410-
4E4D6A561B1C5DC000FD2E49 /* MRPRCommentCell.h */,
3411-
4E4D6A571B1C5DC000FD2E49 /* MRPRCommentCell.m */,
34123416
4E4D6A741B1C6C6100FD2E49 /* MRPRTopCell.h */,
34133417
4E4D6A751B1C6C6100FD2E49 /* MRPRTopCell.m */,
34143418
4E4D6A771B1C6C7800FD2E49 /* MRPRDetailCell.h */,
34153419
4E4D6A781B1C6C7800FD2E49 /* MRPRDetailCell.m */,
3420+
4E4D6AA41B1DBA3A00FD2E49 /* MRPRDisclosureCell.h */,
3421+
4E4D6AA51B1DBA3A00FD2E49 /* MRPRDisclosureCell.m */,
3422+
4E4D6A561B1C5DC000FD2E49 /* MRPRCommentCell.h */,
3423+
4E4D6A571B1C5DC000FD2E49 /* MRPRCommentCell.m */,
34163424
4E4D6A7A1B1C6CDE00FD2E49 /* CommitListCell.h */,
34173425
4E4D6A7B1B1C6CDE00FD2E49 /* CommitListCell.m */,
34183426
4E4D6A7D1B1C6D1E00FD2E49 /* CommitContentCell.h */,
@@ -3421,10 +3429,12 @@
34213429
4E4D6A811B1C6D5F00FD2E49 /* FilesChangeIntroduceCell.m */,
34223430
4E4D6A831B1C6D8200FD2E49 /* FileChangeListCell.h */,
34233431
4E4D6A841B1C6D8200FD2E49 /* FileChangeListCell.m */,
3432+
4E4D6AAA1B1EED6A00FD2E49 /* AddCommentCell.h */,
3433+
4E4D6AAB1B1EED6A00FD2E49 /* AddCommentCell.m */,
34243434
4E4D6A861B1C6E1A00FD2E49 /* MRPRAcceptEditCell.h */,
34253435
4E4D6A871B1C6E1B00FD2E49 /* MRPRAcceptEditCell.m */,
3426-
4E4D6A891B1C6E3000FD2E49 /* MRPRAcceptCheckCell.h */,
3427-
4E4D6A8A1B1C6E3000FD2E49 /* MRPRAcceptCheckCell.m */,
3436+
4E4D6A891B1C6E3000FD2E49 /* TextCheckMarkCell.h */,
3437+
4E4D6A8A1B1C6E3000FD2E49 /* TextCheckMarkCell.m */,
34283438
);
34293439
path = Cell;
34303440
sourceTree = "<group>";
@@ -3876,6 +3886,7 @@
38763886
8EF643BA19FF7E2900F7EEB0 /* MemberCell.m in Sources */,
38773887
4ECE8B021A3946C10021E29C /* JobManager.m in Sources */,
38783888
4ECE8B031A3946C10021E29C /* TagsManager.m in Sources */,
3889+
4E4D6AAC1B1EED6A00FD2E49 /* AddCommentCell.m in Sources */,
38793890
8EA6D1CC19E240C40076D59C /* UITTTAttributedLabel.m in Sources */,
38803891
8EF643C619FF7E2900F7EEB0 /* TitleValueCell.m in Sources */,
38813892
4EA7F1671A6D192B00A046BD /* ODRefreshControl.m in Sources */,
@@ -4154,14 +4165,15 @@
41544165
8EA6D1AB19E240C40076D59C /* main.m in Sources */,
41554166
B94C1B691AC945D30000C271 /* NewProjectViewController.m in Sources */,
41564167
4E996BD91ABA776500C704F1 /* UserInfoTextCell.m in Sources */,
4168+
4E4D6AA61B1DBA3A00FD2E49 /* MRPRDisclosureCell.m in Sources */,
41574169
8E1C3E0819E8DFE300EF3032 /* AboutViewController.m in Sources */,
41584170
4E6BA2D71A1EE6AF005FD721 /* AFHTTPRequestOperation.m in Sources */,
41594171
4EF8181F1B05C9D8005F974B /* ProjectLineNoteActivity.m in Sources */,
41604172
8EF643A919FF7E2900F7EEB0 /* MessageMediaItemCCell.m in Sources */,
41614173
4ECF70461B18557E000280FF /* MRPRS.m in Sources */,
41624174
4ECE8AE41A3943E80021E29C /* UIImage+Common.m in Sources */,
41634175
8EF643D619FF7E9F00F7EEB0 /* ProjectTopicCell.m in Sources */,
4164-
4E4D6A8B1B1C6E3100FD2E49 /* MRPRAcceptCheckCell.m in Sources */,
4176+
4E4D6A8B1B1C6E3100FD2E49 /* TextCheckMarkCell.m in Sources */,
41654177
4E6BA2DA1A1EE6AF005FD721 /* AFHTTPSessionManager.m in Sources */,
41664178
4EA6790A1A1461C3001A0324 /* ProjectFile.m in Sources */,
41674179
4ECE8AE61A3943E80021E29C /* UILabel+Common.m in Sources */,

Coding_iOS/Models/MRPR.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,25 @@
1010
#import "MRPRComment.h"
1111
#import "Depot.h"
1212

13+
typedef NS_ENUM(NSInteger, MRPRStatus) {
14+
MRPRStatusCanMerge = 0,
15+
MRPRStatusCannotMerge,
16+
MRPRStatusAccept,
17+
MRPRStatusRefuse,
18+
MRPRStatusCancel
19+
};
20+
1321
@interface MRPR : NSObject
1422
@property (strong, nonatomic) NSNumber *id, *iid, *srcExist;
15-
@property (strong, nonatomic) NSString *title, *path, *srcBranch, *desBranch, *merge_status;
23+
@property (strong, nonatomic) NSString *title, *path, *srcBranch, *desBranch, *merge_status, *src_owner_name;
1624
@property (strong, nonatomic) User *author, *action_author;
17-
@property (strong, nonatomic) NSDate *created_at;
25+
@property (strong, nonatomic) NSDate *created_at, *action_at;
1826
@property (strong, nonatomic) Depot *source_depot;
1927
@property (strong, nonatomic) NSAttributedString *attributeTitle, *attributeTail;
20-
@property (strong, nonatomic) NSMutableArray *comments;
28+
@property (assign, nonatomic) MRPRStatus status;
29+
30+
- (NSString *)statusDisplay;
31+
- (NSString *)des_owner_name;
2132

2233
- (BOOL)isMR;
2334
- (BOOL)isPR;

Coding_iOS/Models/MRPR.m

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,59 @@ @implementation MRPR
1212
- (NSAttributedString *)attributeTitle{
1313
NSString *iidStr = [NSString stringWithFormat:@"#%@", _iid.stringValue? _iid.stringValue: @""];
1414
NSString *titleStr = _title? _title: @"";
15-
NSMutableAttributedString *attriString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@", iidStr, titleStr]];
16-
[attriString addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:14],
15+
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@", iidStr, titleStr]];
16+
[attrString addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:14],
1717
NSForegroundColorAttributeName : [UIColor colorWithHexString:@"0x4E90BF"]}
1818
range:NSMakeRange(0, iidStr.length)];
19-
[attriString addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:14],
19+
[attrString addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:14],
2020
NSForegroundColorAttributeName : [UIColor colorWithHexString:@"0x333333"]}
2121
range:NSMakeRange(iidStr.length + 1, titleStr.length)];
22-
return attriString;
22+
return attrString;
2323

2424
}
2525
- (NSAttributedString *)attributeTail{
2626
NSString *nameStr = _author.name? _author.name: @"";
2727
NSString *timeStr = _created_at? [_created_at stringTimesAgo]: @"";
28-
NSMutableAttributedString *attriString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@", nameStr, timeStr]];
29-
[attriString addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:12],
28+
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@", nameStr, timeStr]];
29+
[attrString addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:12],
3030
NSForegroundColorAttributeName : [UIColor colorWithHexString:@"0x333333"]}
3131
range:NSMakeRange(0, nameStr.length)];
32-
[attriString addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:12],
32+
[attrString addAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:12],
3333
NSForegroundColorAttributeName : [UIColor colorWithHexString:@"0xA9A9A9"]}
3434
range:NSMakeRange(nameStr.length + 1, timeStr.length)];
35-
return attriString;
35+
return attrString;
36+
}
37+
38+
- (NSString *)statusDisplay{
39+
NSString *statusDisplay;
40+
switch (_status) {
41+
case MRPRStatusCanMerge:
42+
statusDisplay = @"可合并";
43+
break;
44+
case MRPRStatusCannotMerge:
45+
statusDisplay = @"不可自动合并";
46+
break;
47+
case MRPRStatusAccept:
48+
statusDisplay = @"已合并";
49+
break;
50+
case MRPRStatusRefuse:
51+
statusDisplay = @"已拒绝";
52+
break;
53+
case MRPRStatusCancel:
54+
statusDisplay = @"已取消";
55+
break;
56+
default:
57+
break;
58+
}
59+
return statusDisplay;
60+
}
61+
- (NSString *)des_owner_name{
62+
NSArray *pathComponents = [_path componentsSeparatedByString:@"/"];
63+
if (pathComponents.count == 7) {
64+
return pathComponents[2];
65+
}else{
66+
return nil;
67+
}
3668
}
3769

3870
- (BOOL)isMR{
@@ -60,10 +92,25 @@ - (NSString *)toFileChangesPath{
6092
- (NSString *)p_prePath{
6193
NSString *prePath = nil;
6294
NSArray *pathComponents = [_path componentsSeparatedByString:@"/"];
63-
if (pathComponents.count == 7) {
64-
prePath = [NSString stringWithFormat:@"api/user/%@/project/%@/git/%@/%@/", pathComponents[1], pathComponents[3], pathComponents[5], pathComponents[6]];
95+
if (pathComponents.count == 8) {
96+
prePath = [NSString stringWithFormat:@"api/user/%@/project/%@/git/%@/%@/", pathComponents[2], pathComponents[4], pathComponents[6], pathComponents[7]];
6597
}
6698
return prePath;
6799
}
68100

101+
- (void)setMerge_status:(NSString *)merge_status{
102+
_merge_status = merge_status;
103+
if ([_merge_status isEqualToString:@"CANMERGE"]) {
104+
_status = MRPRStatusCanMerge;
105+
}else if ([_merge_status isEqualToString:@"CANNOTMERGE"]){
106+
_status = MRPRStatusCannotMerge;
107+
}else if ([_merge_status isEqualToString:@"ACCEPTED"]){
108+
_status = MRPRStatusAccept;
109+
}else if ([_merge_status isEqualToString:@"REFUSED"]){
110+
_status = MRPRStatusRefuse;
111+
}else if ([_merge_status isEqualToString:@"CANCEL"]){
112+
_status = MRPRStatusCancel;
113+
}
114+
}
115+
69116
@end

Coding_iOS/Models/MRPRBaseInfo.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
#import "MRPR.h"
1111
#import "MRPRComment.h"
1212

13-
1413
@interface MRPRBaseInfo : NSObject
15-
@property (strong, nonatomic) MRPR *pull_request, *merge_request;
14+
@property (strong, nonatomic) MRPR *pull_request, *merge_request, *mrpr;
1615
@property (strong, nonatomic) NSMutableArray *discussions;
1716
@property (strong, nonatomic) NSString *pull_request_description, *merge_request_description;
1817
@property (strong, nonatomic) NSNumber *can_edit_src_branch, *can_edit;
1918
@property (readwrite, nonatomic, strong) NSDictionary *propertyArrayMap;
19+
@property (assign, nonatomic) CGFloat contentHeight;
20+
@property (readwrite, nonatomic, strong) HtmlMedia *htmlMedia;
21+
2022

2123
@end

Coding_iOS/Models/MRPRBaseInfo.m

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,25 @@ - (instancetype)init
1515
if (self) {
1616
_propertyArrayMap = [NSDictionary dictionaryWithObjectsAndKeys:
1717
@"MRPRComment", @"discussions", nil];
18+
_contentHeight = 1;
1819
}
1920
return self;
2021
}
22+
- (MRPR *)mrpr{
23+
if (_pull_request) {
24+
return _pull_request;
25+
}else{
26+
return _merge_request;
27+
}
28+
}
29+
30+
- (void)setPull_request_description:(NSString *)pull_request_description{
31+
_htmlMedia = [HtmlMedia htmlMediaWithString:pull_request_description showType:MediaShowTypeCode];
32+
_pull_request_description = _htmlMedia.contentDisplay;
33+
}
34+
35+
- (void)setMerge_request_description:(NSString *)merge_request_description{
36+
_htmlMedia = [HtmlMedia htmlMediaWithString:merge_request_description showType:MediaShowTypeCode];
37+
_merge_request_description = _htmlMedia.contentDisplay;
38+
}
2139
@end

Coding_iOS/Util/OC_Category/UIImageView+Common.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@
99
#import <UIKit/UIKit.h>
1010

1111
@interface UIImageView (Common)
12-
- (void)doCircleFrame;
13-
- (void)doNotCircleFrame;
14-
- (void)doBorderWidth:(CGFloat)width color:(UIColor *)color cornerRadius:(CGFloat)cornerRadius;
12+
1513
@end

Coding_iOS/Util/OC_Category/UIView+Common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ typedef NS_ENUM(NSInteger, EaseBlankPageType)
2828
};
2929

3030
@interface UIView (Common)
31+
- (void)doCircleFrame;
32+
- (void)doNotCircleFrame;
33+
- (void)doBorderWidth:(CGFloat)width color:(UIColor *)color cornerRadius:(CGFloat)cornerRadius;
34+
3135
- (UIViewController *)findViewController;
3236
- (void)addBadgeTip:(NSString *)badgeValue withCenterPosition:(CGPoint)center;
3337
- (void)addBadgeTip:(NSString *)badgeValue;

Coding_iOS/Util/OC_Category/UIView+Common.m

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,28 @@
1313
@implementation UIView (Common)
1414
static char LoadingViewKey, BlankPageViewKey;
1515

16+
- (void)doCircleFrame{
17+
self.layer.masksToBounds = YES;
18+
self.layer.cornerRadius = self.frame.size.width/2;
19+
self.layer.borderWidth = 0.5;
20+
self.layer.borderColor = [UIColor colorWithHexString:@"0xdddddd"].CGColor;
21+
}
22+
- (void)doNotCircleFrame{
23+
self.layer.cornerRadius = 0.0;
24+
self.layer.borderWidth = 0.0;
25+
}
26+
27+
- (void)doBorderWidth:(CGFloat)width color:(UIColor *)color cornerRadius:(CGFloat)cornerRadius{
28+
self.layer.masksToBounds = YES;
29+
self.layer.cornerRadius = cornerRadius;
30+
self.layer.borderWidth = width;
31+
if (!color) {
32+
self.layer.borderColor = [UIColor colorWithHexString:@"0xdddddd"].CGColor;
33+
}else{
34+
self.layer.borderColor = color.CGColor;
35+
}
36+
}
37+
1638
- (UIViewController *)findViewController
1739
{
1840
for (UIView* next = self; next; next = next.superview) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// AddCommentCell.h
3+
// Coding_iOS
4+
//
5+
// Created by Ease on 15/6/3.
6+
// Copyright (c) 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface AddCommentCell : UITableViewCell
12+
+ (CGFloat)cellHeight;
13+
14+
@end

0 commit comments

Comments
 (0)