Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
coderZsq committed Sep 29, 2019
1 parent 2cf9bdf commit 15e788d
Show file tree
Hide file tree
Showing 36 changed files with 629 additions and 175 deletions.
112 changes: 61 additions & 51 deletions SQManagement/SQManagement.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Large diffs are not rendered by default.

52 changes: 15 additions & 37 deletions SQManagement/SQManagement/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="lLY-Fn-4KU">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="uRP-gN-aQg">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
Expand Down Expand Up @@ -51,37 +51,6 @@
</objects>
<point key="canvasLocation" x="213.04347826086959" y="220.98214285714286"/>
</scene>
<!--Add Connection View Controller-->
<scene sceneID="lcI-xu-gSS">
<objects>
<tableViewController id="Vc5-ha-Xna" customClass="SQAddConnectionViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="wwX-G7-be9">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<inset key="separatorInset" minX="55" minY="0.0" maxX="0.0" maxY="0.0"/>
<connections>
<outlet property="dataSource" destination="Vc5-ha-Xna" id="Tk7-85-uoO"/>
<outlet property="delegate" destination="Vc5-ha-Xna" id="RYT-nj-HC7"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="Nns-H4-WZ8">
<barButtonItem key="leftBarButtonItem" title="取消" id="R4a-ex-d6Y">
<connections>
<action selector="cancelButtonClick:" destination="Vc5-ha-Xna" id="KyL-BW-0we"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" title="完成" id="fkl-dW-kZg">
<connections>
<action selector="doneButtonClick:" destination="Vc5-ha-Xna" id="mFc-Vp-hXa"/>
</connections>
</barButtonItem>
</navigationItem>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="eTB-bg-kbW" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2963.768115942029" y="220.98214285714286"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="vDH-oL-Qck">
<objects>
Expand All @@ -93,7 +62,7 @@
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="Vc5-ha-Xna" kind="relationship" relationship="rootViewController" id="fz7-Uc-Rfk"/>
<segue destination="QcG-as-Xre" kind="relationship" relationship="rootViewController" id="fz7-Uc-Rfk"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="NqX-mb-Pr1" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -133,7 +102,6 @@
<connections>
<segue destination="PlH-0R-Wjq" kind="relationship" relationship="viewControllers" id="iUc-np-fGY"/>
<segue destination="xFr-vW-13h" kind="relationship" relationship="viewControllers" id="IQy-6v-MzS"/>
<segue destination="uRP-gN-aQg" kind="relationship" relationship="viewControllers" id="GSD-lH-mxt"/>
</connections>
</tabBarController>
<placeholder placeholderIdentifier="IBFirstResponder" id="MDi-ko-vWX" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -220,11 +188,11 @@
</objects>
<point key="canvasLocation" x="2053.6231884057975" y="-1132.3660714285713"/>
</scene>
<!--Project Time View Controller-->
<!--Time Events View Controller-->
<scene sceneID="bfH-z7-Xcl">
<objects>
<viewController id="UBK-s3-7bQ" customClass="SQProjectTimeViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="z9s-qE-ToN" customClass="SQProjectTimeView">
<viewController id="UBK-s3-7bQ" customClass="SQTimeEventsViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="z9s-qE-ToN">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
Expand All @@ -239,5 +207,15 @@
</objects>
<point key="canvasLocation" x="2960.8695652173915" y="-1132.3660714285713"/>
</scene>
<!--SQConnectionEventsViewController-->
<scene sceneID="oLX-Ku-mI7">
<objects>
<viewControllerPlaceholder storyboardName="SQConnectionEventsViewController" id="QcG-as-Xre" sceneMemberID="viewController">
<navigationItem key="navigationItem" id="w0h-tl-iXN"/>
</viewControllerPlaceholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="pU1-iL-rMu" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2963.768115942029" y="220.98214285714286"/>
</scene>
</scenes>
</document>
17 changes: 0 additions & 17 deletions SQManagement/SQManagement/Coms/SQProjectTimeView.h

This file was deleted.

21 changes: 0 additions & 21 deletions SQManagement/SQManagement/Coms/SQProjectTimeView.m

This file was deleted.

21 changes: 0 additions & 21 deletions SQManagement/SQManagement/Coms/SQProjectTimeView.xib

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

NS_ASSUME_NONNULL_BEGIN

@interface SQAddConnectionViewController : UITableViewController
@class SQConnectionModel;

@interface SQConnectionEventsViewController : UITableViewController

@property (nonatomic, strong) SQConnectionModel *connection;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,33 @@
// Copyright © 2019 Castie!. All rights reserved.
//

#import "SQAddConnectionViewController.h"
#import "SQConnectionEventsViewController.h"
#import "SQProfileHeaderView.h"
#import "SQConnectionPropertyCell.h"
#import "UIColor+SQExtension.h"
#import "UIView+SQExtension.h"
#import "SQConnectionModel.h"

@interface SQAddConnectionViewController () <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
@interface SQConnectionEventsViewController () <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
@property (nonatomic, strong) NSArray *dataSource;
@property (nonatomic, strong) SQProfileHeaderView *headerView;
@property (nonatomic, strong) SQConnectionModel *connection;
@end

@implementation SQAddConnectionViewController
@implementation SQConnectionEventsViewController

- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"新增人脉";
if (!self.connection) {
self.title = @"新增人脉";
self.connection = [SQConnectionModel new];
} else {
self.title = self.connection.name;
}
self.dataSource = @[
@[@"姓名", @"角色", @"职业", @"地区", @"行业", @"影响力", @"亲密程度", @"黄金人脉圈"],
@[@"联系方式", @"社交记录"],
@[@"特征", @"工作", @"爱好", @"特殊细节", @"给我的启发"],
];
self.connection = [SQConnectionModel new];
self.tableView.backgroundColor = [UIColor colorWithHexString:@"f8f8f8"];
[self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([SQConnectionPropertyCell class]) bundle:nil] forCellReuseIdentifier:NSStringFromClass([SQConnectionPropertyCell class])];
self.headerView = [SQProfileHeaderView headerView];
Expand Down Expand Up @@ -70,7 +73,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
SQConnectionPropertyCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([SQConnectionPropertyCell class])];
cell.titleLabel.text = self.dataSource[indexPath.section][indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
[self.connection map:indexPath.row bind:cell.inputLabel];
if (indexPath.section == 0) {
[self.connection map:indexPath.row bind:cell.inputLabel];
}
return cell;
}

Expand Down Expand Up @@ -104,14 +109,6 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
self.headerView.profileImageView.image = [info objectForKey:UIImagePickerControllerOriginalImage];
}

- (IBAction)doneButtonClick:(UIBarButtonItem *)sender {
[self dismiss];
}

- (IBAction)cancelButtonClick:(UIBarButtonItem *)sender {
[self dismiss];
}

- (void)dismiss {
[self dismissViewControllerAnimated:YES completion:nil];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Vc5-ha-Xna">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Connection Events View Controller-->
<scene sceneID="lcI-xu-gSS">
<objects>
<tableViewController id="Vc5-ha-Xna" customClass="SQConnectionEventsViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="wwX-G7-be9">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<inset key="separatorInset" minX="55" minY="0.0" maxX="0.0" maxY="0.0"/>
<connections>
<outlet property="dataSource" destination="Vc5-ha-Xna" id="Tk7-85-uoO"/>
<outlet property="delegate" destination="Vc5-ha-Xna" id="RYT-nj-HC7"/>
</connections>
</tableView>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="eTB-bg-kbW" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2963.768115942029" y="220.98214285714286"/>
</scene>
</scenes>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#import "SQConnectionsViewController.h"
#import "SQH1TitleView.h"
#import "SQSearchInputView.h"
#import "SQAuthorizationManager.h"
#import "SQAuthorizationTool.h"
#import "SQConnectionEventsViewController.h"
#import "SQConnectionModel.h"

@interface SQConnectionsViewController ()
@property (nonatomic, strong) NSMutableArray *dataSource;
Expand All @@ -21,7 +23,7 @@ - (void)viewDidLoad {
[super viewDidLoad];
self.title = @"人脉";
self.dataSource = [NSMutableArray array];
[SQAuthorizationManager fetchContacts:^(NSString *name, NSArray *phoneNumbers) {
[SQAuthorizationTool fetchContacts:^(NSString *name, NSArray *phoneNumbers) {
[self.dataSource addObject:name];
[self.tableView reloadData];
}];
Expand Down Expand Up @@ -59,4 +61,13 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege
return 44;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
SQConnectionEventsViewController *connectionEventsVc = [[UIStoryboard storyboardWithName:NSStringFromClass(SQConnectionEventsViewController.class) bundle:nil] instantiateInitialViewController];
SQConnectionModel *connection = [SQConnectionModel new];
connection.name = self.dataSource[indexPath.row];
connectionEventsVc.connection = connection;
[self.navigationController pushViewController:connectionEventsVc animated:YES];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface SQProjectTimeViewController : UIViewController
@interface SQTimeEventsViewController : UIViewController

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
// Copyright © 2019 Castie!. All rights reserved.
//

#import "SQProjectTimeViewController.h"
#import "SQTimeEventsViewController.h"

@interface SQProjectTimeViewController ()
@interface SQTimeEventsViewController ()

@end

@implementation SQProjectTimeViewController
@implementation SQTimeEventsViewController

- (void)viewDidLoad {
[super viewDidLoad];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "SQTimeViewController.h"
#import "SQH1TitleView.h"
#import "SQSearchInputView.h"
#import "SQProjectTimeViewController.h"
#import "SQTimeEventsViewController.h"

@interface SQTimeViewController ()
@end
Expand Down Expand Up @@ -55,7 +55,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self.navigationController pushViewController:[SQProjectTimeViewController new] animated:YES];
[self.navigationController pushViewController:[SQTimeEventsViewController new] animated:YES];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface SQAuthorizationManager : NSObject
@interface SQAuthorizationTool : NSObject

+ (void)fetchContacts: (void(^)(NSString *, NSArray *))callback;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//
// SQAuthorizationManager.m
// SQAuthorizationTool.m
// SQManagement
//
// Created by 朱双泉 on 2019/9/22.
// Copyright © 2019 Castie!. All rights reserved.
//

#import "SQAuthorizationManager.h"
#import "SQAuthorizationTool.h"
#import <Contacts/Contacts.h>

@implementation SQAuthorizationManager
@implementation SQAuthorizationTool

+ (void)fetchContacts:(void (^)(NSString *, NSArray *))callback {
dispatch_async(dispatch_get_main_queue(), ^{
Expand Down
Loading

0 comments on commit 15e788d

Please sign in to comment.