Skip to content

Commit 410ca98

Browse files
committed
add
1 parent 070b5b4 commit 410ca98

19 files changed

+352
-70
lines changed

SQManagement/Podfile

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ target 'SQManagement' do
66
# use_frameworks!
77

88
# Pods for SQManagement
9-
pod 'QMUIKit'
109

1110
end

SQManagement/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
PODFILE CHECKSUM: c96a98d382c67df3be677a23851945fe11a9af28
1+
PODFILE CHECKSUM: 3f7c4419b8b079eb1bc8490d3ee796bcbb510bb7
22

3-
COCOAPODS: 1.5.3
3+
COCOAPODS: 1.8.1

SQManagement/SQManagement.xcodeproj/project.pbxproj

+26
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
objects = {
88

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

4043
/* Begin PBXFileReference section */
44+
14040345233F887200D0BC12 /* SQTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQTabBarController.h; sourceTree = "<group>"; };
45+
14040346233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQTabbarControllerAnimatedTransitioning.h; sourceTree = "<group>"; };
46+
14040347233F887200D0BC12 /* SQTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQTabBarController.m; sourceTree = "<group>"; };
47+
14040348233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SQTabbarControllerAnimatedTransitioning.m; sourceTree = "<group>"; };
48+
14233203233F923700D4FA3B /* SQConnectionModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQConnectionModel.h; sourceTree = "<group>"; };
49+
14233204233F923700D4FA3B /* SQConnectionModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SQConnectionModel.m; sourceTree = "<group>"; };
4150
142787F1233CB4AB0000FEBB /* SQTimeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQTimeViewController.h; sourceTree = "<group>"; };
4251
142787F2233CB4AB0000FEBB /* SQTimeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SQTimeViewController.m; sourceTree = "<group>"; };
4352
142787F4233CBC1F0000FEBB /* SQEnergyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SQEnergyViewController.h; sourceTree = "<group>"; };
@@ -102,6 +111,15 @@
102111
/* End PBXFrameworksBuildPhase section */
103112

104113
/* Begin PBXGroup section */
114+
14233206233F923C00D4FA3B /* Model */ = {
115+
isa = PBXGroup;
116+
children = (
117+
14233203233F923700D4FA3B /* SQConnectionModel.h */,
118+
14233204233F923700D4FA3B /* SQConnectionModel.m */,
119+
);
120+
path = Model;
121+
sourceTree = "<group>";
122+
};
105123
14D633B123376549004FD86A /* Tools */ = {
106124
isa = PBXGroup;
107125
children = (
@@ -139,6 +157,10 @@
139157
14E97DC92335014B004FC20D /* SceneDelegate.m */,
140158
14DC37E52337509E00867A92 /* SQNavigationController.h */,
141159
14DC37E62337509E00867A92 /* SQNavigationController.m */,
160+
14040345233F887200D0BC12 /* SQTabBarController.h */,
161+
14040347233F887200D0BC12 /* SQTabBarController.m */,
162+
14040346233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.h */,
163+
14040348233F887200D0BC12 /* SQTabbarControllerAnimatedTransitioning.m */,
142164
142787FA233CBC980000FEBB /* SQH1TitleViewController.h */,
143165
142787FB233CBC980000FEBB /* SQH1TitleViewController.m */,
144166
);
@@ -201,6 +223,7 @@
201223
14DC37D123374F7700867A92 /* Main */,
202224
14DC37D023374F6E00867A92 /* Coms */,
203225
14D633B123376549004FD86A /* Tools */,
226+
14233206233F923C00D4FA3B /* Model */,
204227
14DC37E423374FC300867A92 /* UI */,
205228
14DC37D423374FA500867A92 /* SQExtension */,
206229
14E97DCE2335014B004FC20D /* Main.storyboard */,
@@ -340,11 +363,14 @@
340363
14E97DD32335014B004FC20D /* SQManagement.xcdatamodeld in Sources */,
341364
14DC37CC23374CFB00867A92 /* SQH1TitleView.m in Sources */,
342365
149AC8982339F7D4009C88AB /* SQSearchInputView.m in Sources */,
366+
14040349233F887300D0BC12 /* SQTabBarController.m in Sources */,
343367
14D633B0233763FF004FD86A /* SQAuthorizationManager.m in Sources */,
368+
14233205233F923700D4FA3B /* SQConnectionModel.m in Sources */,
344369
142787F6233CBC1F0000FEBB /* SQEnergyViewController.m in Sources */,
345370
142787F3233CB4AB0000FEBB /* SQTimeViewController.m in Sources */,
346371
149AC8882339BEE6009C88AB /* SQProfileHeaderView.m in Sources */,
347372
14DC37E023374FA500867A92 /* NSObject+SQExtension.m in Sources */,
373+
1404034A233F887300D0BC12 /* SQTabbarControllerAnimatedTransitioning.m in Sources */,
348374
14DC37CF23374DC600867A92 /* SQConnectionsViewController.m in Sources */,
349375
149AC8852339B92F009C88AB /* SQAddConnectionViewController.m in Sources */,
350376
14E97DCA2335014B004FC20D /* SceneDelegate.m in Sources */,

SQManagement/SQManagement/Base.lproj/Main.storyboard

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<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">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
5-
<deployment identifier="iOS"/>
65
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
76
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
87
</dependencies>
@@ -122,7 +121,7 @@
122121
<!--Tab Bar Controller-->
123122
<scene sceneID="DFE-3V-fK0">
124123
<objects>
125-
<tabBarController id="lLY-Fn-4KU" sceneMemberID="viewController">
124+
<tabBarController id="lLY-Fn-4KU" customClass="SQTabBarController" sceneMemberID="viewController">
126125
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="gky-Ow-BLO">
127126
<rect key="frame" x="0.0" y="0.0" width="414" height="49"/>
128127
<autoresizingMask key="autoresizingMask"/>

SQManagement/SQManagement/Coms/SQConnectionPropertyCell.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
1313
@interface SQConnectionPropertyCell : UITableViewCell
1414

1515
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
16+
@property (weak, nonatomic) IBOutlet UILabel *inputLabel;
1617
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
17-
@property (weak, nonatomic) IBOutlet UITextField *contentTextField;
1818

1919
@end
2020

SQManagement/SQManagement/Coms/SQConnectionPropertyCell.xib

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<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">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
5-
<deployment identifier="iOS"/>
65
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
76
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
87
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -17,11 +16,6 @@
1716
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
1817
<autoresizingMask key="autoresizingMask"/>
1918
<subviews>
20-
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hol-Rp-PFM">
21-
<rect key="frame" x="108" y="12.5" width="196" height="19"/>
22-
<fontDescription key="fontDescription" type="system" pointSize="14"/>
23-
<textInputTraits key="textInputTraits"/>
24-
</textField>
2519
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Iaw-Cj-dWE">
2620
<rect key="frame" x="16" y="7" width="30" height="30"/>
2721
<color key="backgroundColor" red="0.97254901960784312" green="0.97254901960784312" blue="0.97254901960784312" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
@@ -36,21 +30,26 @@
3630
<nil key="textColor"/>
3731
<nil key="highlightedColor"/>
3832
</label>
33+
<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">
34+
<rect key="frame" x="305" y="22" width="0.0" height="0.0"/>
35+
<fontDescription key="fontDescription" type="system" pointSize="15"/>
36+
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
37+
<nil key="highlightedColor"/>
38+
</label>
3939
</subviews>
4040
<constraints>
41-
<constraint firstItem="hol-Rp-PFM" firstAttribute="leading" secondItem="HFh-tr-qYF" secondAttribute="trailing" constant="10" id="4gc-fV-s2x"/>
42-
<constraint firstItem="hol-Rp-PFM" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="IjH-72-C8b"/>
43-
<constraint firstAttribute="trailing" secondItem="hol-Rp-PFM" secondAttribute="trailing" constant="16" id="Jez-Zq-S3Y"/>
41+
<constraint firstItem="ma5-P8-FFX" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="DqX-Yk-nzL"/>
4442
<constraint firstItem="Iaw-Cj-dWE" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="SKc-6E-cl6"/>
43+
<constraint firstAttribute="trailing" secondItem="ma5-P8-FFX" secondAttribute="trailing" constant="15" id="ULU-TB-sZf"/>
4544
<constraint firstItem="HFh-tr-qYF" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="gpl-rm-Q5e"/>
4645
<constraint firstItem="Iaw-Cj-dWE" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="ifc-7h-gmK"/>
4746
<constraint firstItem="HFh-tr-qYF" firstAttribute="leading" secondItem="Iaw-Cj-dWE" secondAttribute="trailing" constant="10" id="nVa-9V-Mne"/>
4847
</constraints>
4948
</tableViewCellContentView>
5049
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
5150
<connections>
52-
<outlet property="contentTextField" destination="hol-Rp-PFM" id="9y0-0d-Bh5"/>
5351
<outlet property="iconImageView" destination="Iaw-Cj-dWE" id="Vxd-bI-qR1"/>
52+
<outlet property="inputLabel" destination="ma5-P8-FFX" id="B3h-RT-lXd"/>
5453
<outlet property="titleLabel" destination="HFh-tr-qYF" id="JeS-4O-0q8"/>
5554
</connections>
5655
<point key="canvasLocation" x="73.913043478260875" y="51.5625"/>

SQManagement/SQManagement/Main/SQH1TitleViewController.h

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
1212

1313
@interface SQH1TitleViewController : UITableViewController
1414

15+
- (BOOL)isShowNavigationShadowImage;
16+
1517
@end
1618

1719
NS_ASSUME_NONNULL_END

SQManagement/SQManagement/Main/SQH1TitleViewController.m

+12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "SQH1TitleViewController.h"
1010
#import "SQH1TitleView.h"
1111
#import "UIViewController+SQExtension.h"
12+
#import "UIImage+SQExtension.h"
1213

1314
@interface SQH1TitleViewController ()
1415
@property (nonatomic, weak) UILabel *titleLabel;
@@ -44,9 +45,20 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSIntege
4445
return 44;
4546
}
4647

48+
- (BOOL)isShowNavigationShadowImage {
49+
return YES;
50+
}
51+
4752
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
4853
[self.view endEditing:YES];
4954
self.titleLabel.textColor = scrollView.contentOffset.y > -48.f ? self.defaultColor : [UIColor clearColor];
55+
if ([self isShowNavigationShadowImage]) {
56+
UIColor *color = [UIColor whiteColor];
57+
if (self.titleLabel.textColor == self.defaultColor) {
58+
color = [[UIColor lightGrayColor] colorWithAlphaComponent:0.3];
59+
}
60+
[self.navigationController.navigationBar setShadowImage:[UIImage imageWithColor:color]];
61+
}
5062
}
5163

5264
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// SQTabBarController.h
3+
// SQMagnet
4+
//
5+
// Created by 朱双泉 on 2019/7/12.
6+
// Copyright © 2019 Castie!. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface SQTabBarController : UITabBarController
14+
15+
@end
16+
17+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//
2+
// SQTabBarController.m
3+
// SQMagnet
4+
//
5+
// Created by 朱双泉 on 2019/7/12.
6+
// Copyright © 2019 Castie!. All rights reserved.
7+
//
8+
9+
#import "SQTabBarController.h"
10+
#import "SQTabbarControllerAnimatedTransitioning.h"
11+
#import "UIColor+SQExtension.h"
12+
13+
@interface SQTabBarController () <UITabBarControllerDelegate>
14+
15+
@property (nonatomic, assign) NSUInteger lastSelectIndex;
16+
17+
@end
18+
19+
@implementation SQTabBarController
20+
21+
- (void)viewDidLoad {
22+
[super viewDidLoad];
23+
self.delegate = self;
24+
[self hookApplicationWillEnterForeground];
25+
}
26+
27+
- (void)hookApplicationWillEnterForeground {
28+
self.view.backgroundColor = [UIColor whiteColor];
29+
if (@available(iOS 13.0, *)) {
30+
self.view.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull trait) {
31+
if (trait.userInterfaceStyle == UIUserInterfaceStyleDark) {
32+
return [UIColor colorWithHexString:@"#1c1c1e"];
33+
} else {
34+
return [UIColor whiteColor];
35+
}
36+
}];
37+
}
38+
}
39+
40+
- (id <UIViewControllerAnimatedTransitioning>)tabBarController:(UITabBarController *)tabBarController animationControllerForTransitionFromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC {
41+
NSUInteger fromVCIndex = [self.childViewControllers indexOfObject:fromVC];
42+
NSUInteger toVCIndex = [self.childViewControllers indexOfObject:toVC];
43+
SQTabbarControllerAnimatedTransitioning *animatedTransitioning = [SQTabbarControllerAnimatedTransitioning new];
44+
animatedTransitioning.fromVCIndex = fromVCIndex;
45+
animatedTransitioning.toVCIndex = toVCIndex;
46+
return animatedTransitioning;
47+
}
48+
49+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// SQTabbarControllerAnimatedTransitioning.h
3+
// SQMagnet
4+
//
5+
// Created by 朱双泉 on 2019/7/12.
6+
// Copyright © 2019 Castie!. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface SQTabbarControllerAnimatedTransitioning : NSObject <UIViewControllerAnimatedTransitioning>
14+
15+
@property (nonatomic, assign) NSUInteger fromVCIndex;
16+
17+
@property (nonatomic, assign) NSUInteger toVCIndex;
18+
19+
@end
20+
21+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// SQTabbarControllerAnimatedTransitioning.m
3+
// SQMagnet
4+
//
5+
// Created by 朱双泉 on 2019/7/12.
6+
// Copyright © 2019 Castie!. All rights reserved.
7+
//
8+
9+
#import "SQTabbarControllerAnimatedTransitioning.h"
10+
11+
static CGFloat const kPadding = 10;
12+
static CGFloat const kDamping = 0.75;
13+
static CGFloat const kVelocity = 2;
14+
15+
@implementation SQTabbarControllerAnimatedTransitioning
16+
17+
- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext {
18+
return kDamping;
19+
}
20+
21+
- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
22+
23+
UIViewController * toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
24+
UIViewController * fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
25+
UIView * containerView = [transitionContext containerView];
26+
CGFloat translation = containerView.bounds.size.width + kPadding;
27+
CGAffineTransform transform = CGAffineTransformMakeTranslation ((self.fromVCIndex > self.toVCIndex ? YES : NO) ? translation : -translation, 0);
28+
toViewController.view.transform = CGAffineTransformInvert (transform);
29+
[containerView addSubview:toViewController.view];
30+
31+
[UIView animateWithDuration:[self transitionDuration:transitionContext] delay:0 usingSpringWithDamping:kDamping initialSpringVelocity:kVelocity options:UIViewAnimationOptionCurveEaseInOut animations:^{
32+
fromViewController.view.transform = transform;
33+
toViewController.view.transform = CGAffineTransformIdentity;
34+
} completion:^(BOOL finished) {
35+
fromViewController.view.transform = CGAffineTransformIdentity;
36+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
37+
}];
38+
}
39+
40+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// SQConnectionModel.h
3+
// SQManagement
4+
//
5+
// Created by 朱双泉 on 2019/9/28.
6+
// Copyright © 2019 Castie!. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface SQConnectionModel : NSObject
14+
15+
@property (nonatomic, copy) NSString *name;
16+
@property (nonatomic, copy) NSString *role;
17+
@property (nonatomic, copy) NSString *occupation;
18+
@property (nonatomic, copy) NSString *region;
19+
@property (nonatomic, copy) NSString *industry;
20+
@property (nonatomic, copy) NSString *effect;
21+
@property (nonatomic, copy) NSString *intimacy;
22+
@property (nonatomic, copy) NSString *goldenCircle;
23+
24+
- (void)map:(NSUInteger)row bind:(UIView *)view;
25+
26+
@end
27+
28+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)