Skip to content

Commit e7d3863

Browse files
committed
完成
1 parent 3fecf46 commit e7d3863

16 files changed

Lines changed: 434 additions & 42 deletions

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
4E217F1A1A71007800F6DF88 /* SVWebViewController.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4E217F1C1A71007800F6DF88 /* SVWebViewController.strings */; };
3939
4E2906A21A403B7D008A5B97 /* FileDownloadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E2906A11A403B7D008A5B97 /* FileDownloadView.m */; };
4040
4E35A99F1A3EC47E00CE35F1 /* FileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E35A99E1A3EC47E00CE35F1 /* FileViewController.m */; };
41+
4E38CF5F1A7A28AF005536C0 /* CodeBranchTagButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E38CF5E1A7A28AF005536C0 /* CodeBranchTagButton.m */; };
42+
4E38CF621A7B7C99005536C0 /* CodeBranchOrTag.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E38CF611A7B7C99005536C0 /* CodeBranchOrTag.m */; };
43+
4E38CF641A7B8DD4005536C0 /* icon_triangle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E38CF631A7B8DD4005536C0 /* icon_triangle@2x.png */; };
4144
4E3AD3CF1A273A4A005C749B /* FAImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E3AD3C11A273A4A005C749B /* FAImageView.m */; };
4245
4E3AD3D01A273A4A005C749B /* NSString+FontAwesome.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E3AD3C31A273A4A005C749B /* NSString+FontAwesome.m */; };
4346
4E3AD3D11A273A4A005C749B /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4E3AD3C51A273A4A005C749B /* FontAwesome.ttf */; };
@@ -577,6 +580,11 @@
577580
4E2906A11A403B7D008A5B97 /* FileDownloadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileDownloadView.m; sourceTree = "<group>"; };
578581
4E35A99D1A3EC47E00CE35F1 /* FileViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileViewController.h; sourceTree = "<group>"; };
579582
4E35A99E1A3EC47E00CE35F1 /* FileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileViewController.m; sourceTree = "<group>"; };
583+
4E38CF5D1A7A28AF005536C0 /* CodeBranchTagButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeBranchTagButton.h; sourceTree = "<group>"; };
584+
4E38CF5E1A7A28AF005536C0 /* CodeBranchTagButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CodeBranchTagButton.m; sourceTree = "<group>"; };
585+
4E38CF601A7B7C99005536C0 /* CodeBranchOrTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeBranchOrTag.h; sourceTree = "<group>"; };
586+
4E38CF611A7B7C99005536C0 /* CodeBranchOrTag.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CodeBranchOrTag.m; sourceTree = "<group>"; };
587+
4E38CF631A7B8DD4005536C0 /* icon_triangle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_triangle@2x.png"; sourceTree = "<group>"; };
580588
4E3AD3C01A273A4A005C749B /* FAImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FAImageView.h; sourceTree = "<group>"; };
581589
4E3AD3C11A273A4A005C749B /* FAImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FAImageView.m; sourceTree = "<group>"; };
582590
4E3AD3C21A273A4A005C749B /* NSString+FontAwesome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+FontAwesome.h"; sourceTree = "<group>"; };
@@ -2283,6 +2291,7 @@
22832291
4E03ACA21A5D0ABB002B000B /* textBg@2x.png */,
22842292
4E03ACA71A5D3BD1002B000B /* topic_comment_icon@2x.png */,
22852293
4EA7F12B1A6D0C4D00A046BD /* icon_project_private@2x.png */,
2294+
4E38CF631A7B8DD4005536C0 /* icon_triangle@2x.png */,
22862295
);
22872296
path = Images;
22882297
sourceTree = "<group>";
@@ -2443,6 +2452,8 @@
24432452
4EA679121A1466A6001A0324 /* ProjectFiles.m */,
24442453
4EA679081A1461C3001A0324 /* ProjectFile.h */,
24452454
4EA679091A1461C3001A0324 /* ProjectFile.m */,
2455+
4E38CF601A7B7C99005536C0 /* CodeBranchOrTag.h */,
2456+
4E38CF611A7B7C99005536C0 /* CodeBranchOrTag.m */,
24462457
);
24472458
path = Models;
24482459
sourceTree = "<group>";
@@ -2627,6 +2638,8 @@
26272638
4E2906A11A403B7D008A5B97 /* FileDownloadView.m */,
26282639
4E07D30F1A4D1484009EDDF2 /* EaseStartView.h */,
26292640
4E07D3101A4D1484009EDDF2 /* EaseStartView.m */,
2641+
4E38CF5D1A7A28AF005536C0 /* CodeBranchTagButton.h */,
2642+
4E38CF5E1A7A28AF005536C0 /* CodeBranchTagButton.m */,
26302643
);
26312644
path = Views;
26322645
sourceTree = "<group>";
@@ -3014,6 +3027,7 @@
30143027
8EA6D16E19E240C40076D59C /* nav_tweet_mine@2x.png in Resources */,
30153028
4E76D4D71A5A71C50094A35E /* taskPriority0_small@2x.png in Resources */,
30163029
4E217F0D1A70EDC700F6DF88 /* SVWebViewController.bundle in Resources */,
3030+
4E38CF641A7B8DD4005536C0 /* icon_triangle@2x.png in Resources */,
30173031
8EABE3CB19F1211D00A17784 /* topic.html in Resources */,
30183032
8E97CE551A0A3410006F9AD7 /* tweetBtn_Nav@2x.png in Resources */,
30193033
8E872D0019EFEFF7002C8F34 /* tweet_more_comment_icon@2x.png in Resources */,
@@ -3177,6 +3191,7 @@
31773191
8EF643BF19FF7E2900F7EEB0 /* SettingTextCell.m in Sources */,
31783192
8E64ED8419ED0CE3006E99DA /* QBImagePickerGroupCell.m in Sources */,
31793193
4ECE8AE71A3943E80021E29C /* UITableView+Common.m in Sources */,
3194+
4E38CF621A7B7C99005536C0 /* CodeBranchOrTag.m in Sources */,
31803195
8EA6D1CF19E240C40076D59C /* ObjcRuntime.m in Sources */,
31813196
4E03ACA61A5D2060002B000B /* UIVerticalAlignmentLabel.m in Sources */,
31823197
4E6BA2DF1A1EE6AF005FD721 /* AFURLRequestSerialization.m in Sources */,
@@ -3348,6 +3363,7 @@
33483363
8EA6D1C319E240C40076D59C /* User.m in Sources */,
33493364
8EA6D1FB19E240C40076D59C /* MJPhotoToolbar.m in Sources */,
33503365
8EF643CF19FF7E2900F7EEB0 /* TweetDetailCommentCell.m in Sources */,
3366+
4E38CF5F1A7A28AF005536C0 /* CodeBranchTagButton.m in Sources */,
33513367
8E64ED8119ED0CE3006E99DA /* QBAssetsCollectionViewLayout.m in Sources */,
33523368
8EA6D1C819E240C40076D59C /* UIBadgeView.m in Sources */,
33533369
8EF643BD19FF7E2900F7EEB0 /* ProjectListCell.m in Sources */,

Coding_iOS/Controllers/ProjectViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ - (void)refreshWithViewType:(ProjectViewType)viewType{
245245
codeListView.codeTreeFileOfRefBlock = ^(CodeTree_File *curCodeTreeFile, NSString *ref){
246246
[weakSelf goToVCWith:curCodeTreeFile andRef:ref];
247247
};
248+
[codeListView addBranchTagButton];
248249
codeListView;
249250
});
250251
}
@@ -274,6 +275,9 @@ - (void)refreshWithViewType:(ProjectViewType)viewType{
274275
}
275276
[self saveCurContentView:curView];
276277
[self.view addSubview:curView];
278+
[curView mas_makeConstraints:^(MASConstraintMaker *make) {
279+
make.edges.equalTo(self.view);
280+
}];
277281
}
278282
if (_curIndex != ProjectViewTypeMembers && _proMemberVC) {
279283
[_proMemberVC willHiden];

Coding_iOS/Controllers/RootControllers/RootTabViewController.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,19 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
5757
#pragma mark Private_M
5858
- (void)setupViewControllers {
5959
Project_RootViewController *project = [[Project_RootViewController alloc] init];
60-
UIViewController *nav_project = [[UINavigationController alloc] initWithRootViewController:project];
60+
UINavigationController *nav_project = [[UINavigationController alloc] initWithRootViewController:project];
6161

6262
MyTask_RootViewController *mytask = [[MyTask_RootViewController alloc] init];
63-
UIViewController *nav_mytask = [[UINavigationController alloc] initWithRootViewController:mytask];
63+
UINavigationController *nav_mytask = [[UINavigationController alloc] initWithRootViewController:mytask];
6464

6565
Tweet_RootViewController *tweet = [[Tweet_RootViewController alloc] init];
66-
UIViewController *nav_tweet = [[UINavigationController alloc] initWithRootViewController:tweet];
66+
UINavigationController *nav_tweet = [[UINavigationController alloc] initWithRootViewController:tweet];
6767

6868
Message_RootViewController *message = [[Message_RootViewController alloc] init];
69-
7069
UINavigationController *nav_message = [[UINavigationController alloc] initWithRootViewController:message];
7170

7271
Me_RootViewController *me = [[Me_RootViewController alloc] init];
73-
UIViewController *nav_me = [[UINavigationController alloc] initWithRootViewController:me];
72+
UINavigationController *nav_me = [[UINavigationController alloc] initWithRootViewController:me];
7473

7574
[self setViewControllers:@[nav_project, nav_mytask, nav_tweet, nav_message, nav_me]];
7675

Coding_iOS/Controllers/TaskDescriptionViewController.m

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,22 @@ - (void)viewDidLoad {
2727
[super viewDidLoad];
2828
// Do any additional setup after loading the view.
2929
if (!_segmentedControl) {
30-
_segmentedControl = [[UISegmentedControl alloc] initWithItems:@[@"编辑", @"预览"]];
31-
[_segmentedControl setWidth:80 forSegmentAtIndex:0];
32-
[_segmentedControl setWidth:80 forSegmentAtIndex:1];
33-
[_segmentedControl setTitleTextAttributes:@{
34-
NSFontAttributeName: [UIFont boldSystemFontOfSize:16],
35-
NSForegroundColorAttributeName: [UIColor colorWithHexString:@"0x28303b"]
36-
}
37-
forState:UIControlStateSelected];
38-
[_segmentedControl setTitleTextAttributes:@{
39-
NSFontAttributeName: [UIFont boldSystemFontOfSize:16],
40-
NSForegroundColorAttributeName: [UIColor whiteColor]
41-
} forState:UIControlStateNormal];
42-
[_segmentedControl addTarget:self action:@selector(segmentedControlSelected:) forControlEvents:UIControlEventValueChanged];
30+
_segmentedControl = ({
31+
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:@[@"编辑", @"预览"]];
32+
[segmentedControl setWidth:80 forSegmentAtIndex:0];
33+
[segmentedControl setWidth:80 forSegmentAtIndex:1];
34+
[segmentedControl setTitleTextAttributes:@{
35+
NSFontAttributeName: [UIFont boldSystemFontOfSize:16],
36+
NSForegroundColorAttributeName: [UIColor colorWithHexString:@"0x28303b"]
37+
}
38+
forState:UIControlStateSelected];
39+
[segmentedControl setTitleTextAttributes:@{
40+
NSFontAttributeName: [UIFont boldSystemFontOfSize:16],
41+
NSForegroundColorAttributeName: [UIColor whiteColor]
42+
} forState:UIControlStateNormal];
43+
[segmentedControl addTarget:self action:@selector(segmentedControlSelected:) forControlEvents:UIControlEventValueChanged];
44+
segmentedControl;
45+
});
4346

4447
self.navigationItem.titleView = _segmentedControl;
4548
}
1.04 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// CodeBranchOrTag.h
3+
// Coding_iOS
4+
//
5+
// Created by Ease on 15/1/30.
6+
// Copyright (c) 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface CodeBranchOrTag : NSObject
12+
@property (strong, nonatomic) NSString *name;
13+
@property (strong, nonatomic) NSNumber *is_default_branch, *is_protected;
14+
@end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// CodeBranchOrTag.m
3+
// Coding_iOS
4+
//
5+
// Created by Ease on 15/1/30.
6+
// Copyright (c) 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import "CodeBranchOrTag.h"
10+
11+
@implementation CodeBranchOrTag
12+
13+
@end

Coding_iOS/Models/Projects.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ typedef NS_ENUM(NSInteger, ProjectsType)
5959
- (NSString *)toDetailPath;
6060

6161
- (NSString *)localMembersPath;
62+
63+
- (NSString *)toBranchOrTagPath:(NSString *)path;
6264
@end
6365

6466

Coding_iOS/Models/Projects.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ - (NSString *)toDetailPath{
108108
- (NSString *)localMembersPath{
109109
return [NSString stringWithFormat:@"%@_MembersPath", self.id.stringValue];
110110
}
111+
112+
- (NSString *)toBranchOrTagPath:(NSString *)path{
113+
return [NSString stringWithFormat:@"api/user/%@/project/%@/git/%@", self.owner_user_name, self.name, path];
114+
}
111115
@end
112116

113117

Coding_iOS/Util/Manager/Coding_NetAPIManager.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#import "CodeFile.h"
2222
#import "ProjectFolders.h"
2323
#import "ProjectFiles.h"
24+
#import "CodeBranchOrTag.h"
2425

2526
@interface Coding_NetAPIManager : NSObject
2627
+ (instancetype)sharedManager;
@@ -58,8 +59,9 @@
5859

5960

6061
//Code
61-
- (void)request_CodeTree:(CodeTree *)codeTree withPro:(Project *)project codeTreeBlock:(void (^)(id codeTreeData, NSError *codeTreeError))block andCodeTreeInfoBlock:(void (^)(id codeTreeInfoData, NSError *codeTreeInfoError))infoBlock;
62+
- (void)request_CodeTree:(CodeTree *)codeTree withPro:(Project *)project codeTreeBlock:(void (^)(id codeTreeData, NSError *codeTreeError))block;
6263
- (void)request_CodeFile:(CodeFile *)codeFile withPro:(Project *)project andBlock:(void (^)(id data, NSError *error))block;
64+
- (void)request_CodeBranchOrTagWithPath:(NSString *)path withPro:(Project *)project andBlock:(void (^)(id data, NSError *error))block;
6365

6466
//Task
6567
- (void)request_AddTask:(Task *)task andBlock:(void (^)(id data, NSError *error))block;

0 commit comments

Comments
 (0)