-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
352 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,5 @@ target 'SQManagement' do | |
# use_frameworks! | ||
|
||
# Pods for SQManagement | ||
pod 'QMUIKit' | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
21 changes: 21 additions & 0 deletions
21
SQManagement/SQManagement/Main/SQTabbarControllerAnimatedTransitioning.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
40 changes: 40 additions & 0 deletions
40
SQManagement/SQManagement/Main/SQTabbarControllerAnimatedTransitioning.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.