diff --git a/SQManagement/SQManagement.xcodeproj/project.pbxproj b/SQManagement/SQManagement.xcodeproj/project.pbxproj index 21c23391..041bd8c9 100644 --- a/SQManagement/SQManagement.xcodeproj/project.pbxproj +++ b/SQManagement/SQManagement.xcodeproj/project.pbxproj @@ -7,6 +7,11 @@ objects = { /* Begin PBXBuildFile section */ + 149AC8852339B92F009C88AB /* SQAddConnectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 149AC8842339B92F009C88AB /* SQAddConnectionViewController.m */; }; + 149AC8882339BEE6009C88AB /* SQProfileHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 149AC8872339BEE6009C88AB /* SQProfileHeaderView.m */; }; + 149AC88A2339BEF1009C88AB /* SQProfileHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 149AC8892339BEF1009C88AB /* SQProfileHeaderView.xib */; }; + 149AC88E2339C146009C88AB /* SQConnectionPropertyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 149AC88C2339C146009C88AB /* SQConnectionPropertyCell.m */; }; + 149AC88F2339C146009C88AB /* SQConnectionPropertyCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 149AC88D2339C146009C88AB /* SQConnectionPropertyCell.xib */; }; 14D633B0233763FF004FD86A /* SQAuthorizationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14D633AF233763FF004FD86A /* SQAuthorizationManager.m */; }; 14D633B52337674F004FD86A /* SQSearchInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14D633B22337674F004FD86A /* SQSearchInputView.m */; }; 14D633B62337674F004FD86A /* SQSearchInputView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14D633B42337674F004FD86A /* SQSearchInputView.xib */; }; @@ -30,6 +35,14 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 149AC8832339B92F009C88AB /* SQAddConnectionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQAddConnectionViewController.h; sourceTree = ""; }; + 149AC8842339B92F009C88AB /* SQAddConnectionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SQAddConnectionViewController.m; sourceTree = ""; }; + 149AC8862339BEE6009C88AB /* SQProfileHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQProfileHeaderView.h; sourceTree = ""; }; + 149AC8872339BEE6009C88AB /* SQProfileHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SQProfileHeaderView.m; sourceTree = ""; }; + 149AC8892339BEF1009C88AB /* SQProfileHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SQProfileHeaderView.xib; sourceTree = ""; }; + 149AC88B2339C146009C88AB /* SQConnectionPropertyCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQConnectionPropertyCell.h; sourceTree = ""; }; + 149AC88C2339C146009C88AB /* SQConnectionPropertyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SQConnectionPropertyCell.m; sourceTree = ""; }; + 149AC88D2339C146009C88AB /* SQConnectionPropertyCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SQConnectionPropertyCell.xib; sourceTree = ""; }; 14D633AE233763FF004FD86A /* SQAuthorizationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQAuthorizationManager.h; sourceTree = ""; }; 14D633AF233763FF004FD86A /* SQAuthorizationManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SQAuthorizationManager.m; sourceTree = ""; }; 14D633B22337674F004FD86A /* SQSearchInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQSearchInputView.m; sourceTree = ""; }; @@ -98,6 +111,12 @@ 14DC37C823374CFB00867A92 /* SQH1TitleView.h */, 14DC37CA23374CFB00867A92 /* SQH1TitleView.m */, 14DC37C923374CFB00867A92 /* SQH1TitleView.xib */, + 149AC8862339BEE6009C88AB /* SQProfileHeaderView.h */, + 149AC8872339BEE6009C88AB /* SQProfileHeaderView.m */, + 149AC8892339BEF1009C88AB /* SQProfileHeaderView.xib */, + 149AC88B2339C146009C88AB /* SQConnectionPropertyCell.h */, + 149AC88C2339C146009C88AB /* SQConnectionPropertyCell.m */, + 149AC88D2339C146009C88AB /* SQConnectionPropertyCell.xib */, ); path = Coms; sourceTree = ""; @@ -137,6 +156,8 @@ children = ( 14DC37CD23374DC600867A92 /* SQConnectionsViewController.h */, 14DC37CE23374DC600867A92 /* SQConnectionsViewController.m */, + 149AC8832339B92F009C88AB /* SQAddConnectionViewController.h */, + 149AC8842339B92F009C88AB /* SQAddConnectionViewController.m */, ); path = UI; sourceTree = ""; @@ -257,6 +278,8 @@ 14E97DD82335014C004FC20D /* LaunchScreen.storyboard in Resources */, 14E97DD52335014C004FC20D /* Assets.xcassets in Resources */, 14E97DD02335014B004FC20D /* Main.storyboard in Resources */, + 149AC88A2339BEF1009C88AB /* SQProfileHeaderView.xib in Resources */, + 149AC88F2339C146009C88AB /* SQConnectionPropertyCell.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -298,12 +321,15 @@ 14DC37E72337509E00867A92 /* SQNavigationController.m in Sources */, 14DC37DF23374FA500867A92 /* UIViewController+SQExtension.m in Sources */, 14E97DC72335014B004FC20D /* AppDelegate.m in Sources */, + 149AC88E2339C146009C88AB /* SQConnectionPropertyCell.m in Sources */, 14E97DD32335014B004FC20D /* SQManagement.xcdatamodeld in Sources */, 14DC37CC23374CFB00867A92 /* SQH1TitleView.m in Sources */, 14D633B0233763FF004FD86A /* SQAuthorizationManager.m in Sources */, + 149AC8882339BEE6009C88AB /* SQProfileHeaderView.m in Sources */, 14DC37E023374FA500867A92 /* NSObject+SQExtension.m in Sources */, 14DC37CF23374DC600867A92 /* SQConnectionsViewController.m in Sources */, 14D633B52337674F004FD86A /* SQSearchInputView.m in Sources */, + 149AC8852339B92F009C88AB /* SQAddConnectionViewController.m in Sources */, 14E97DCA2335014B004FC20D /* SceneDelegate.m in Sources */, 14DC37E223374FA500867A92 /* UIImage+SQExtension.m in Sources */, ); diff --git a/SQManagement/SQManagement/Base.lproj/Main.storyboard b/SQManagement/SQManagement/Base.lproj/Main.storyboard index c1bea4e6..d2f54211 100644 --- a/SQManagement/SQManagement/Base.lproj/Main.storyboard +++ b/SQManagement/SQManagement/Base.lproj/Main.storyboard @@ -2,6 +2,7 @@ + @@ -20,7 +21,11 @@ - + + + + + @@ -45,5 +50,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.h b/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.h new file mode 100644 index 00000000..1a38eebb --- /dev/null +++ b/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.h @@ -0,0 +1,19 @@ +// +// SQConnectionPropertyCell.h +// SQManagement +// +// Created by 朱双泉 on 2019/9/24. +// Copyright © 2019 Castie!. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface SQConnectionPropertyCell : UITableViewCell + +@property (weak, nonatomic) IBOutlet UILabel *titleLabel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.m b/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.m new file mode 100644 index 00000000..846fbd03 --- /dev/null +++ b/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.m @@ -0,0 +1,13 @@ +// +// SQConnectionPropertyCell.m +// SQManagement +// +// Created by 朱双泉 on 2019/9/24. +// Copyright © 2019 Castie!. All rights reserved. +// + +#import "SQConnectionPropertyCell.h" + +@implementation SQConnectionPropertyCell + +@end diff --git a/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.xib b/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.xib new file mode 100644 index 00000000..cf60eea6 --- /dev/null +++ b/SQManagement/SQManagement/Coms/SQConnectionPropertyCell.xib @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SQManagement/SQManagement/Coms/SQProfileHeaderView.h b/SQManagement/SQManagement/Coms/SQProfileHeaderView.h new file mode 100644 index 00000000..a069c7cb --- /dev/null +++ b/SQManagement/SQManagement/Coms/SQProfileHeaderView.h @@ -0,0 +1,19 @@ +// +// SQProfileHeaderView.h +// SQManagement +// +// Created by 朱双泉 on 2019/9/24. +// Copyright © 2019 Castie!. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface SQProfileHeaderView : UIView + ++ (instancetype)headerView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SQManagement/SQManagement/Coms/SQProfileHeaderView.m b/SQManagement/SQManagement/Coms/SQProfileHeaderView.m new file mode 100644 index 00000000..de746e93 --- /dev/null +++ b/SQManagement/SQManagement/Coms/SQProfileHeaderView.m @@ -0,0 +1,18 @@ +// +// SQProfileHeaderView.m +// SQManagement +// +// Created by 朱双泉 on 2019/9/24. +// Copyright © 2019 Castie!. All rights reserved. +// + +#import "SQProfileHeaderView.h" + +@implementation SQProfileHeaderView + ++ (instancetype)headerView { + SQProfileHeaderView *headerView = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self.class) owner:nil options:nil].firstObject; + return headerView; +} + +@end diff --git a/SQManagement/SQManagement/Coms/SQProfileHeaderView.xib b/SQManagement/SQManagement/Coms/SQProfileHeaderView.xib new file mode 100644 index 00000000..851e181e --- /dev/null +++ b/SQManagement/SQManagement/Coms/SQProfileHeaderView.xib @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SQManagement/SQManagement/Coms/SQSearchInputView.xib b/SQManagement/SQManagement/Coms/SQSearchInputView.xib index 25b32cd4..8d36c834 100644 --- a/SQManagement/SQManagement/Coms/SQSearchInputView.xib +++ b/SQManagement/SQManagement/Coms/SQSearchInputView.xib @@ -23,12 +23,22 @@ + + + + + + + + + + diff --git a/SQManagement/SQManagement/UI/SQAddConnectionViewController.h b/SQManagement/SQManagement/UI/SQAddConnectionViewController.h new file mode 100644 index 00000000..e6a23889 --- /dev/null +++ b/SQManagement/SQManagement/UI/SQAddConnectionViewController.h @@ -0,0 +1,17 @@ +// +// SQAddConnectionViewController.h +// SQManagement +// +// Created by 朱双泉 on 2019/9/24. +// Copyright © 2019 Castie!. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface SQAddConnectionViewController : UITableViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/SQManagement/SQManagement/UI/SQAddConnectionViewController.m b/SQManagement/SQManagement/UI/SQAddConnectionViewController.m new file mode 100644 index 00000000..56fb3457 --- /dev/null +++ b/SQManagement/SQManagement/UI/SQAddConnectionViewController.m @@ -0,0 +1,56 @@ +// +// SQAddConnectionViewController.m +// SQManagement +// +// Created by 朱双泉 on 2019/9/24. +// Copyright © 2019 Castie!. All rights reserved. +// + +#import "SQAddConnectionViewController.h" +#import "SQProfileHeaderView.h" +#import "SQConnectionPropertyCell.h" + +@interface SQAddConnectionViewController () +@property (nonatomic, strong) NSArray *dataSource; +@end + +@implementation SQAddConnectionViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.title = @"新增人脉"; + self.dataSource = @[@"姓名", @"角色", @"职业", @"地区", @"行业", @"影响力", @"亲密程度", @"黄金人脉圈"]; + [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([SQConnectionPropertyCell class]) bundle:nil] forCellReuseIdentifier:NSStringFromClass([SQConnectionPropertyCell class])]; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.dataSource.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + SQConnectionPropertyCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SQConnectionPropertyCell class])]; + cell.titleLabel.text = self.dataSource[indexPath.row]; + return cell; +} + +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { + return [SQProfileHeaderView headerView]; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + return 100; +} + +- (IBAction)doneButtonClick:(UIBarButtonItem *)sender { + [self dismiss]; +} + +- (IBAction)cancelButtonClick:(UIBarButtonItem *)sender { + [self dismiss]; +} + +- (void)dismiss { + [self dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git a/SQManagement/SQManagement/UI/SQConnectionsViewController.m b/SQManagement/SQManagement/UI/SQConnectionsViewController.m index eee8306d..0deeb316 100644 --- a/SQManagement/SQManagement/UI/SQConnectionsViewController.m +++ b/SQManagement/SQManagement/UI/SQConnectionsViewController.m @@ -33,7 +33,7 @@ - (void)viewDidLoad { self.navigationItem.titleView = titleLabel; self.titleLabel = titleLabel; - self.dataSource = @[].mutableCopy; + self.dataSource = [NSMutableArray array]; [SQAuthorizationManager fetchContacts:^(NSString *name, NSArray *phoneNumbers) { [self.dataSource addObject:name]; [self.tableView reloadData]; diff --git "a/SQManagement/\344\272\272\350\204\211\345\275\222\346\241\243\350\241\250.png" "b/SQManagement/\344\272\272\350\204\211\345\275\222\346\241\243\350\241\250.png" new file mode 100644 index 00000000..862461d7 Binary files /dev/null and "b/SQManagement/\344\272\272\350\204\211\345\275\222\346\241\243\350\241\250.png" differ diff --git "a/SQManagement/\350\201\224\347\263\273\344\272\272\345\205\250\346\201\257\350\203\214\346\231\257\345\215\241.png" "b/SQManagement/\350\201\224\347\263\273\344\272\272\345\205\250\346\201\257\350\203\214\346\231\257\345\215\241.png" new file mode 100644 index 00000000..24c422e9 Binary files /dev/null and "b/SQManagement/\350\201\224\347\263\273\344\272\272\345\205\250\346\201\257\350\203\214\346\231\257\345\215\241.png" differ