Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
coderZsq committed Sep 28, 2019
1 parent 070b5b4 commit 410ca98
Show file tree
Hide file tree
Showing 19 changed files with 352 additions and 70 deletions.
1 change: 0 additions & 1 deletion SQManagement/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ target 'SQManagement' do
# use_frameworks!

# Pods for SQManagement
pod 'QMUIKit'

end
4 changes: 2 additions & 2 deletions SQManagement/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PODFILE CHECKSUM: c96a98d382c67df3be677a23851945fe11a9af28
PODFILE CHECKSUM: 3f7c4419b8b079eb1bc8490d3ee796bcbb510bb7

COCOAPODS: 1.5.3
COCOAPODS: 1.8.1
26 changes: 26 additions & 0 deletions SQManagement/SQManagement.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
14040349233F887300D0BC12 /* SQTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14040347233F887200D0BC12 /* SQTabBarController.m */; };
1404034A233F887300D0BC12 /* SQTabbarControllerAnimatedTransitioning.m in Sources */ = {isa = PBXBuildFile; fileRef = 14040348233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.m */; };
14233205233F923700D4FA3B /* SQConnectionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 14233204233F923700D4FA3B /* SQConnectionModel.m */; };
142787F3233CB4AB0000FEBB /* SQTimeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 142787F2233CB4AB0000FEBB /* SQTimeViewController.m */; };
142787F6233CBC1F0000FEBB /* SQEnergyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 142787F5233CBC1F0000FEBB /* SQEnergyViewController.m */; };
142787FC233CBC980000FEBB /* SQH1TitleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 142787FB233CBC980000FEBB /* SQH1TitleViewController.m */; };
Expand Down Expand Up @@ -38,6 +41,12 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
14040345233F887200D0BC12 /* SQTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQTabBarController.h; sourceTree = "<group>"; };
14040346233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQTabbarControllerAnimatedTransitioning.h; sourceTree = "<group>"; };
14040347233F887200D0BC12 /* SQTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQTabBarController.m; sourceTree = "<group>"; };
14040348233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQTabbarControllerAnimatedTransitioning.m; sourceTree = "<group>"; };
14233203233F923700D4FA3B /* SQConnectionModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQConnectionModel.h; sourceTree = "<group>"; };
14233204233F923700D4FA3B /* SQConnectionModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SQConnectionModel.m; sourceTree = "<group>"; };
142787F1233CB4AB0000FEBB /* SQTimeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQTimeViewController.h; sourceTree = "<group>"; };
142787F2233CB4AB0000FEBB /* SQTimeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SQTimeViewController.m; sourceTree = "<group>"; };
142787F4233CBC1F0000FEBB /* SQEnergyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQEnergyViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -102,6 +111,15 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
14233206233F923C00D4FA3B /* Model */ = {
isa = PBXGroup;
children = (
14233203233F923700D4FA3B /* SQConnectionModel.h */,
14233204233F923700D4FA3B /* SQConnectionModel.m */,
);
path = Model;
sourceTree = "<group>";
};
14D633B123376549004FD86A /* Tools */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -139,6 +157,10 @@
14E97DC92335014B004FC20D /* SceneDelegate.m */,
14DC37E52337509E00867A92 /* SQNavigationController.h */,
14DC37E62337509E00867A92 /* SQNavigationController.m */,
14040345233F887200D0BC12 /* SQTabBarController.h */,
14040347233F887200D0BC12 /* SQTabBarController.m */,
14040346233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.h */,
14040348233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.m */,
142787FA233CBC980000FEBB /* SQH1TitleViewController.h */,
142787FB233CBC980000FEBB /* SQH1TitleViewController.m */,
);
Expand Down Expand Up @@ -201,6 +223,7 @@
14DC37D123374F7700867A92 /* Main */,
14DC37D023374F6E00867A92 /* Coms */,
14D633B123376549004FD86A /* Tools */,
14233206233F923C00D4FA3B /* Model */,
14DC37E423374FC300867A92 /* UI */,
14DC37D423374FA500867A92 /* SQExtension */,
14E97DCE2335014B004FC20D /* Main.storyboard */,
Expand Down Expand Up @@ -340,11 +363,14 @@
14E97DD32335014B004FC20D /* SQManagement.xcdatamodeld in Sources */,
14DC37CC23374CFB00867A92 /* SQH1TitleView.m in Sources */,
149AC8982339F7D4009C88AB /* SQSearchInputView.m in Sources */,
14040349233F887300D0BC12 /* SQTabBarController.m in Sources */,
14D633B0233763FF004FD86A /* SQAuthorizationManager.m in Sources */,
14233205233F923700D4FA3B /* SQConnectionModel.m in Sources */,
142787F6233CBC1F0000FEBB /* SQEnergyViewController.m in Sources */,
142787F3233CB4AB0000FEBB /* SQTimeViewController.m in Sources */,
149AC8882339BEE6009C88AB /* SQProfileHeaderView.m in Sources */,
14DC37E023374FA500867A92 /* NSObject+SQExtension.m in Sources */,
1404034A233F887300D0BC12 /* SQTabbarControllerAnimatedTransitioning.m in Sources */,
14DC37CF23374DC600867A92 /* SQConnectionsViewController.m in Sources */,
149AC8852339B92F009C88AB /* SQAddConnectionViewController.m in Sources */,
14E97DCA2335014B004FC20D /* SceneDelegate.m in Sources */,
Expand Down
3 changes: 1 addition & 2 deletions SQManagement/SQManagement/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -122,7 +121,7 @@
<!--Tab Bar Controller-->
<scene sceneID="DFE-3V-fK0">
<objects>
<tabBarController id="lLY-Fn-4KU" sceneMemberID="viewController">
<tabBarController id="lLY-Fn-4KU" customClass="SQTabBarController" sceneMemberID="viewController">
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="gky-Ow-BLO">
<rect key="frame" x="0.0" y="0.0" width="414" height="49"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down
2 changes: 1 addition & 1 deletion SQManagement/SQManagement/Coms/SQConnectionPropertyCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface SQConnectionPropertyCell : UITableViewCell

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *inputLabel;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UITextField *contentTextField;

@end

Expand Down
19 changes: 9 additions & 10 deletions SQManagement/SQManagement/Coms/SQConnectionPropertyCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -17,11 +16,6 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hol-Rp-PFM">
<rect key="frame" x="108" y="12.5" width="196" height="19"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Iaw-Cj-dWE">
<rect key="frame" x="16" y="7" width="30" height="30"/>
<color key="backgroundColor" red="0.97254901960784312" green="0.97254901960784312" blue="0.97254901960784312" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
Expand All @@ -36,21 +30,26 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ma5-P8-FFX">
<rect key="frame" x="305" y="22" width="0.0" height="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="hol-Rp-PFM" firstAttribute="leading" secondItem="HFh-tr-qYF" secondAttribute="trailing" constant="10" id="4gc-fV-s2x"/>
<constraint firstItem="hol-Rp-PFM" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="IjH-72-C8b"/>
<constraint firstAttribute="trailing" secondItem="hol-Rp-PFM" secondAttribute="trailing" constant="16" id="Jez-Zq-S3Y"/>
<constraint firstItem="ma5-P8-FFX" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="DqX-Yk-nzL"/>
<constraint firstItem="Iaw-Cj-dWE" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="SKc-6E-cl6"/>
<constraint firstAttribute="trailing" secondItem="ma5-P8-FFX" secondAttribute="trailing" constant="15" id="ULU-TB-sZf"/>
<constraint firstItem="HFh-tr-qYF" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="gpl-rm-Q5e"/>
<constraint firstItem="Iaw-Cj-dWE" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="ifc-7h-gmK"/>
<constraint firstItem="HFh-tr-qYF" firstAttribute="leading" secondItem="Iaw-Cj-dWE" secondAttribute="trailing" constant="10" id="nVa-9V-Mne"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="contentTextField" destination="hol-Rp-PFM" id="9y0-0d-Bh5"/>
<outlet property="iconImageView" destination="Iaw-Cj-dWE" id="Vxd-bI-qR1"/>
<outlet property="inputLabel" destination="ma5-P8-FFX" id="B3h-RT-lXd"/>
<outlet property="titleLabel" destination="HFh-tr-qYF" id="JeS-4O-0q8"/>
</connections>
<point key="canvasLocation" x="73.913043478260875" y="51.5625"/>
Expand Down
2 changes: 2 additions & 0 deletions SQManagement/SQManagement/Main/SQH1TitleViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN

@interface SQH1TitleViewController : UITableViewController

- (BOOL)isShowNavigationShadowImage;

@end

NS_ASSUME_NONNULL_END
12 changes: 12 additions & 0 deletions SQManagement/SQManagement/Main/SQH1TitleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "SQH1TitleViewController.h"
#import "SQH1TitleView.h"
#import "UIViewController+SQExtension.h"
#import "UIImage+SQExtension.h"

@interface SQH1TitleViewController ()
@property (nonatomic, weak) UILabel *titleLabel;
Expand Down Expand Up @@ -44,9 +45,20 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege
return 44;
}

- (BOOL)isShowNavigationShadowImage {
return YES;
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
[self.view endEditing:YES];
self.titleLabel.textColor = scrollView.contentOffset.y > -48.f ? self.defaultColor : [UIColor clearColor];
if ([self isShowNavigationShadowImage]) {
UIColor *color = [UIColor whiteColor];
if (self.titleLabel.textColor == self.defaultColor) {
color = [[UIColor lightGrayColor] colorWithAlphaComponent:0.3];
}
[self.navigationController.navigationBar setShadowImage:[UIImage imageWithColor:color]];
}
}

@end
17 changes: 17 additions & 0 deletions SQManagement/SQManagement/Main/SQTabBarController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// SQTabBarController.h
// SQMagnet
//
// Created by 朱双泉 on 2019/7/12.
// Copyright © 2019 Castie!. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface SQTabBarController : UITabBarController

@end

NS_ASSUME_NONNULL_END
49 changes: 49 additions & 0 deletions SQManagement/SQManagement/Main/SQTabBarController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// SQTabBarController.m
// SQMagnet
//
// Created by 朱双泉 on 2019/7/12.
// Copyright © 2019 Castie!. All rights reserved.
//

#import "SQTabBarController.h"
#import "SQTabbarControllerAnimatedTransitioning.h"
#import "UIColor+SQExtension.h"

@interface SQTabBarController () <UITabBarControllerDelegate>

@property (nonatomic, assign) NSUInteger lastSelectIndex;

@end

@implementation SQTabBarController

- (void)viewDidLoad {
[super viewDidLoad];
self.delegate = self;
[self hookApplicationWillEnterForeground];
}

- (void)hookApplicationWillEnterForeground {
self.view.backgroundColor = [UIColor whiteColor];
if (@available(iOS 13.0, *)) {
self.view.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull trait) {
if (trait.userInterfaceStyle == UIUserInterfaceStyleDark) {
return [UIColor colorWithHexString:@"#1c1c1e"];
} else {
return [UIColor whiteColor];
}
}];
}
}

- (id <UIViewControllerAnimatedTransitioning>)tabBarController:(UITabBarController *)tabBarController animationControllerForTransitionFromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC {
NSUInteger fromVCIndex = [self.childViewControllers indexOfObject:fromVC];
NSUInteger toVCIndex = [self.childViewControllers indexOfObject:toVC];
SQTabbarControllerAnimatedTransitioning *animatedTransitioning = [SQTabbarControllerAnimatedTransitioning new];
animatedTransitioning.fromVCIndex = fromVCIndex;
animatedTransitioning.toVCIndex = toVCIndex;
return animatedTransitioning;
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// SQTabbarControllerAnimatedTransitioning.h
// SQMagnet
//
// Created by 朱双泉 on 2019/7/12.
// Copyright © 2019 Castie!. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface SQTabbarControllerAnimatedTransitioning : NSObject <UIViewControllerAnimatedTransitioning>

@property (nonatomic, assign) NSUInteger fromVCIndex;

@property (nonatomic, assign) NSUInteger toVCIndex;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// SQTabbarControllerAnimatedTransitioning.m
// SQMagnet
//
// Created by 朱双泉 on 2019/7/12.
// Copyright © 2019 Castie!. All rights reserved.
//

#import "SQTabbarControllerAnimatedTransitioning.h"

static CGFloat const kPadding = 10;
static CGFloat const kDamping = 0.75;
static CGFloat const kVelocity = 2;

@implementation SQTabbarControllerAnimatedTransitioning

- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext {
return kDamping;
}

- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {

UIViewController * toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
UIViewController * fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIView * containerView = [transitionContext containerView];
CGFloat translation = containerView.bounds.size.width + kPadding;
CGAffineTransform transform = CGAffineTransformMakeTranslation ((self.fromVCIndex > self.toVCIndex ? YES : NO) ? translation : -translation, 0);
toViewController.view.transform = CGAffineTransformInvert (transform);
[containerView addSubview:toViewController.view];

[UIView animateWithDuration:[self transitionDuration:transitionContext] delay:0 usingSpringWithDamping:kDamping initialSpringVelocity:kVelocity options:UIViewAnimationOptionCurveEaseInOut animations:^{
fromViewController.view.transform = transform;
toViewController.view.transform = CGAffineTransformIdentity;
} completion:^(BOOL finished) {
fromViewController.view.transform = CGAffineTransformIdentity;
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
}];
}

@end
28 changes: 28 additions & 0 deletions SQManagement/SQManagement/Model/SQConnectionModel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// SQConnectionModel.h
// SQManagement
//
// Created by 朱双泉 on 2019/9/28.
// Copyright © 2019 Castie!. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface SQConnectionModel : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *role;
@property (nonatomic, copy) NSString *occupation;
@property (nonatomic, copy) NSString *region;
@property (nonatomic, copy) NSString *industry;
@property (nonatomic, copy) NSString *effect;
@property (nonatomic, copy) NSString *intimacy;
@property (nonatomic, copy) NSString *goldenCircle;

- (void)map:(NSUInteger)row bind:(UIView *)view;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 410ca98

Please sign in to comment.