Skip to content

Commit a1f37cc

Browse files
committed
基本完成 <项目设置> UI部分
1 parent d92f4b4 commit a1f37cc

8 files changed

Lines changed: 448 additions & 0 deletions

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,9 @@
591591
B94C1B691AC945D30000C271 /* NewProjectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B94C1B681AC945D30000C271 /* NewProjectViewController.m */; };
592592
B94C1B6B1AC945FB0000C271 /* NewProject.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B94C1B6A1AC945FB0000C271 /* NewProject.storyboard */; };
593593
B94C1B6E1AC98CCE0000C271 /* NewProjectTypeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B94C1B6D1AC98CCE0000C271 /* NewProjectTypeViewController.m */; };
594+
B9A00D7F1ACA3A05008BA008 /* ProjectSetting.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B9A00D7E1ACA3A05008BA008 /* ProjectSetting.storyboard */; };
595+
B9A00D821ACA3A17008BA008 /* ProjectSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9A00D811ACA3A17008BA008 /* ProjectSettingViewController.m */; };
596+
B9A00D851ACA3A55008BA008 /* ProjectAdvancedSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9A00D841ACA3A55008BA008 /* ProjectAdvancedSettingViewController.m */; };
594597
E7A046A01A47279E00528C12 /* Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = E7A0469F1A47279E00528C12 /* Helper.m */; };
595598
/* End PBXBuildFile section */
596599

@@ -1499,6 +1502,11 @@
14991502
B94C1B6A1AC945FB0000C271 /* NewProject.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NewProject.storyboard; sourceTree = "<group>"; };
15001503
B94C1B6C1AC98CCE0000C271 /* NewProjectTypeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewProjectTypeViewController.h; sourceTree = "<group>"; };
15011504
B94C1B6D1AC98CCE0000C271 /* NewProjectTypeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewProjectTypeViewController.m; sourceTree = "<group>"; };
1505+
B9A00D7E1ACA3A05008BA008 /* ProjectSetting.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = ProjectSetting.storyboard; sourceTree = "<group>"; };
1506+
B9A00D801ACA3A17008BA008 /* ProjectSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectSettingViewController.h; sourceTree = "<group>"; };
1507+
B9A00D811ACA3A17008BA008 /* ProjectSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectSettingViewController.m; sourceTree = "<group>"; };
1508+
B9A00D831ACA3A55008BA008 /* ProjectAdvancedSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectAdvancedSettingViewController.h; sourceTree = "<group>"; };
1509+
B9A00D841ACA3A55008BA008 /* ProjectAdvancedSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectAdvancedSettingViewController.m; sourceTree = "<group>"; };
15021510
C613B8719C3D38FED828A1E2 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
15031511
E7A0469E1A47279E00528C12 /* Helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Helper.h; sourceTree = "<group>"; };
15041512
E7A0469F1A47279E00528C12 /* Helper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Helper.m; sourceTree = "<group>"; };
@@ -2326,6 +2334,7 @@
23262334
8EA6CF1B19E240C40076D59C /* Controllers */ = {
23272335
isa = PBXGroup;
23282336
children = (
2337+
B9A00D7D1ACA39F1008BA008 /* ProjectSetting */,
23292338
B94C1B661AC945C60000C271 /* NewProject */,
23302339
8EA6CF2819E240C40076D59C /* Login */,
23312340
8EA6CF3219E240C40076D59C /* RootControllers */,
@@ -3041,6 +3050,18 @@
30413050
path = NewProject;
30423051
sourceTree = "<group>";
30433052
};
3053+
B9A00D7D1ACA39F1008BA008 /* ProjectSetting */ = {
3054+
isa = PBXGroup;
3055+
children = (
3056+
B9A00D7E1ACA3A05008BA008 /* ProjectSetting.storyboard */,
3057+
B9A00D801ACA3A17008BA008 /* ProjectSettingViewController.h */,
3058+
B9A00D811ACA3A17008BA008 /* ProjectSettingViewController.m */,
3059+
B9A00D831ACA3A55008BA008 /* ProjectAdvancedSettingViewController.h */,
3060+
B9A00D841ACA3A55008BA008 /* ProjectAdvancedSettingViewController.m */,
3061+
);
3062+
path = ProjectSetting;
3063+
sourceTree = "<group>";
3064+
};
30443065
/* End PBXGroup section */
30453066

30463067
/* Begin PBXNativeTarget section */
@@ -3338,6 +3359,7 @@
33383359
4E76D4E41A5A90CA0094A35E /* [email protected] in Resources */,
33393360
4EA679071A130C24001A0324 /* [email protected] in Resources */,
33403361
8EA6D16719E240C40076D59C /* [email protected] in Resources */,
3362+
B9A00D7F1ACA3A05008BA008 /* ProjectSetting.storyboard in Resources */,
33413363
8EA6D19219E240C40076D59C /* [email protected] in Resources */,
33423364
4E217F141A70EDC700F6DF88 /* [email protected] in Resources */,
33433365
8EA6D19119E240C40076D59C /* [email protected] in Resources */,
@@ -3571,6 +3593,7 @@
35713593
8EA6D13519E240C40076D59C /* ProjectViewController.m in Sources */,
35723594
8EF643AB19FF7E2900F7EEB0 /* TagCCell.m in Sources */,
35733595
4E996BDC1ABA79AB00C704F1 /* UserInfoDetailViewController.m in Sources */,
3596+
B9A00D851ACA3A55008BA008 /* ProjectAdvancedSettingViewController.m in Sources */,
35743597
4E8765671A22E5B40090CFB9 /* SWLongPressGestureRecognizer.m in Sources */,
35753598
0AB591AC1AB6D2F60076C454 /* TweetSendLocaitonMapViewController.m in Sources */,
35763599
4EA7F1611A6D192B00A046BD /* UIButton+WebCache.m in Sources */,
@@ -3682,6 +3705,7 @@
36823705
8EF643C319FF7E2900F7EEB0 /* TaskContentCell.m in Sources */,
36833706
4E59E1D31A5E6B34004DAEEC /* TaskDescriptionViewController.m in Sources */,
36843707
4ECE8AFD1A3946C10021E29C /* AddressManager.m in Sources */,
3708+
B9A00D821ACA3A17008BA008 /* ProjectSettingViewController.m in Sources */,
36853709
8E1C3DED19E7D58A00EF3032 /* ActionSheetDistancePicker.m in Sources */,
36863710
4E6FFB311AB3176900F27B3F /* ProjectReadMeCell.m in Sources */,
36873711
8E59F0F41A00F3B9009A905F /* ProjectCodeListCell.m in Sources */,

Coding_iOS/Controllers/NProjectViewController/NProjectViewController.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,18 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
332332
ProjectActivity *curProAct = [_myProActs.list objectAtIndex:row];
333333
[self goToVCWithItem:nil activity:curProAct isContent:YES inProject:self.myProject];
334334
}
335+
336+
// 如果是自己的项目才能进入设置
337+
if ([self.myProject.owner_id isEqual:[Login curLoginUser].id]) {
338+
// 项目设置
339+
if (indexPath.section == 0 && indexPath.row == 0) {
340+
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"ProjectSetting" bundle:nil];
341+
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"ProjectSettingVC"];
342+
[vc setValue:self.myProject forKey:@"project"];
343+
[self.navigationController pushViewController:vc animated:YES];
344+
}
345+
}
346+
335347
}
336348

337349
#pragma mark goTo VC
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// ProjectAdvancedSettingViewController.h
3+
// Coding_iOS
4+
//
5+
// Created by isaced on 15/3/31.
6+
// Copyright (c) 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface ProjectAdvancedSettingViewController : UITableViewController
12+
13+
@end
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// ProjectAdvancedSettingViewController.m
3+
// Coding_iOS
4+
//
5+
// Created by isaced on 15/3/31.
6+
// Copyright (c) 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import "ProjectAdvancedSettingViewController.h"
10+
11+
@interface ProjectAdvancedSettingViewController ()<UIAlertViewDelegate>
12+
13+
@end
14+
15+
@implementation ProjectAdvancedSettingViewController
16+
17+
- (void)viewDidLoad {
18+
[super viewDidLoad];
19+
20+
self.tableView.tableFooterView = [UIView new];
21+
}
22+
23+
- (void)didReceiveMemoryWarning {
24+
[super didReceiveMemoryWarning];
25+
// Dispose of any resources that can be recreated.
26+
}
27+
#pragma mark UITableView
28+
29+
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
30+
return [UIView new];
31+
}
32+
33+
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
34+
{
35+
// Remove seperator inset
36+
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
37+
[cell setSeparatorInset:UIEdgeInsetsZero];
38+
}
39+
40+
// Prevent the cell from inheriting the Table View's margin settings
41+
if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
42+
[cell setPreservesSuperviewLayoutMargins:NO];
43+
}
44+
45+
// Explictly set your cell's layout margins
46+
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
47+
[cell setLayoutMargins:UIEdgeInsetsZero];
48+
}
49+
}
50+
51+
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
52+
[tableView deselectRowAtIndexPath:indexPath animated:YES];
53+
54+
UIAlertView *alert = [UIAlertView bk_showAlertViewWithTitle:@"需要验证密码" message:@"这是一个危险的操作,请提供登录密码确认!" cancelButtonTitle:@"取消" otherButtonTitles:@[@"确定"] handler:^(UIAlertView *alertView, NSInteger buttonIndex) {
55+
if (buttonIndex == 1) {
56+
// 确定
57+
}
58+
}];
59+
60+
alert.alertViewStyle = UIAlertViewStyleSecureTextInput;
61+
[alert show];
62+
}
63+
64+
@end

0 commit comments

Comments
 (0)