Просмотр исходного кода

1.修改Apex Mobile目录结构,移动Alert -> Common。

Pen Li 8 лет назад
Родитель
Сommit
cc5e0f6e05

+ 0 - 13
Apex Mobile/Apex Mobile/Alert/JLCustomerAlertController.h

@@ -1,13 +0,0 @@
-//
-//  JLAlertController.h
-//  Apex Mobile
-//
-//  Created by Jack on 2018/1/31.
-//  Copyright © 2018年 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface JLCustomerAlertController : UIViewController
-
-@end

+ 0 - 86
Apex Mobile/Apex Mobile/Alert/JLCustomerAlertController.m

@@ -1,86 +0,0 @@
-//
-//  JLAlertController.m
-//  Apex Mobile
-//
-//  Created by Jack on 2018/1/31.
-//  Copyright © 2018年 United Software Applications, Inc. All rights reserved.
-//
-
-#import "JLCustomerAlertController.h"
-#import "JLPresentationController.h"
-
-@interface JLCustomerAlertController () <UIViewControllerTransitioningDelegate>
-
-@end
-
-@implementation JLCustomerAlertController
-
-- (void)comonInit {
-    // present
-    self.transitioningDelegate = self;
-    /**
-     * 非Customer时,
-     * Present会将FromVC.view从Window移除
-     * Dismiss动画结束后VC.view自动添加到Window
-     */
-    self.modalPresentationStyle = UIModalPresentationCustom;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)coder {
-    self = [super initWithCoder:coder];
-    if (self) {
-        [self comonInit];
-    }
-    return self;
-}
-
-- (instancetype)init {
-    if (self = [super init]) {
-        [self comonInit];
-    }
-    return self;
-}
-
-- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
-    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
-        [self comonInit];
-    }
-    return self;
-}
-
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    
-    self.view.backgroundColor = [UIColor whiteColor];
-}
-
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-
-#pragma mark - UIViewControllerTransitioningDelegate
-// ios 8
-- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source {
-    return [[JLPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting];
-}
-
-#pragma mark - Animator
-
-// present
-- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
-    
-    return nil;
-}
-
-// dismiss
-- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
-   
-    return nil;
-    
-}
-
-
-@end

+ 0 - 13
Apex Mobile/Apex Mobile/Alert/JLCustomerNavigationAlertController.h

@@ -1,13 +0,0 @@
-//
-//  JLCustomerNavigationAlertController.h
-//  Apex Mobile
-//
-//  Created by Jack on 2018/1/31.
-//  Copyright © 2018年 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface JLCustomerNavigationAlertController : UINavigationController
-
-@end

+ 0 - 89
Apex Mobile/Apex Mobile/Alert/JLCustomerNavigationAlertController.m

@@ -1,89 +0,0 @@
-//
-//  JLCustomerNavigationAlertController.m
-//  Apex Mobile
-//
-//  Created by Jack on 2018/1/31.
-//  Copyright © 2018年 United Software Applications, Inc. All rights reserved.
-//
-
-#import "JLCustomerNavigationAlertController.h"
-#import "JLPresentationController.h"
-
-@interface JLCustomerNavigationAlertController () <UIViewControllerTransitioningDelegate>
-
-@end
-
-@implementation JLCustomerNavigationAlertController
-
-- (void)comonInit {
-    // present
-    self.transitioningDelegate = self;
-    /**
-     * 非Customer时,
-     * Present会将FromVC.view从Window移除
-     * Dismiss动画结束后VC.view自动添加到Window
-     */
-    self.modalPresentationStyle = UIModalPresentationCustom;
-}
-
-- (instancetype)initWithCoder:(NSCoder *)coder {
-    self = [super initWithCoder:coder];
-    if (self) {
-        [self comonInit];
-    }
-    return self;
-}
-
-- (instancetype)init {
-    if (self = [super init]) {
-        [self comonInit];
-    }
-    return self;
-}
-
-- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
-    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
-        [self comonInit];
-    }
-    return self;
-}
-
-- (instancetype)initWithRootViewController:(UIViewController *)rootViewController {
-    if (self = [super initWithRootViewController:rootViewController]) {
-        [self comonInit];
-    }
-    return self;
-}
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-}
-
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-
-#pragma mark - UIViewControllerTransitioningDelegate
-// ios 8
-- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source {
-    return [[JLPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting];
-}
-
-#pragma mark - Animator
-
-// present
-- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
-    
-    return nil;
-}
-
-// dismiss
-- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
-    
-    return nil;
-    
-}
-
-@end

+ 0 - 13
Apex Mobile/Apex Mobile/Alert/JLPresentationController.h

@@ -1,13 +0,0 @@
-//
-//  JLPresentationController.h
-//  JLTransitionDemo
-//
-//  Created by Jack on 2017/11/20.
-//  Copyright © 2017年 buakaw. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface JLPresentationController : UIPresentationController
-
-@end

+ 0 - 96
Apex Mobile/Apex Mobile/Alert/JLPresentationController.m

@@ -1,96 +0,0 @@
-//
-//  JLPresentationController.m
-//  JLTransitionDemo
-//
-//  Created by Jack on 2017/11/20.
-//  Copyright © 2017年 buakaw. All rights reserved.
-//
-
-#import "JLPresentationController.h"
-
-@interface JLPresentationController ()
-
-@property (nonatomic,strong) UIView *dimmingView;
-
-@end
-
-@implementation JLPresentationController
-
-- (UIView *)dimmingView {
-    if (!_dimmingView) {
-        _dimmingView = [UIView new];
-        _dimmingView.backgroundColor = [UIColor grayColor];
-    }
-    return _dimmingView;
-}
-
-- (void)presentationTransitionWillBegin {
-    self.dimmingView.frame = self.containerView.bounds;
-    self.dimmingView.alpha = 0.f;
-    
-    self.presentedView.layer.cornerRadius = 10.0f;
-    self.presentedView.layer.masksToBounds = YES;
-    
-    [self.containerView addSubview:self.dimmingView];
-    [self.containerView addSubview:self.presentedView];
-    
-    // 确保我们的动画与其他动画一道儿播放。
-    id<UIViewControllerTransitionCoordinator> transitionCoordiantor = self.presentedViewController.transitionCoordinator;
-    [transitionCoordiantor animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
-        self.dimmingView.alpha = .4f;
-    } completion:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
-        
-    }];
-}
-
-- (void)presentationTransitionDidEnd:(BOOL)completed {
-    if (completed) {
-//        [self.dimmingView removeFromSuperview];
-    }
-}
-
-- (CGRect)frameOfPresentedViewInContainerView {
-    CGSize size = self.containerView.bounds.size;
-    
-    UIViewController *presentedVC = self.presentedViewController;
-    size = presentedVC.preferredContentSize;
-    if (size.width <= 0 || size.height <= 0) {
-        size = self.containerView.bounds.size;
-    }
-    
-    CGFloat w = CGRectGetWidth(self.containerView.bounds);
-    CGFloat h = CGRectGetHeight(self.containerView.bounds);
-    
-    return CGRectMake((w - size.width) * 0.5, (h - size.height) * 0.5, size.width, size.height);
-}
-
-- (void)dismissalTransitionWillBegin {
-    // 确保我们的动画与其他动画一道儿播放。
-    id<UIViewControllerTransitionCoordinator> transitionCoordiantor = self.presentedViewController.transitionCoordinator;
-    [transitionCoordiantor animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
-        self.dimmingView.alpha = 0.f;
-    } completion:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
-        
-    }];
-}
-
-- (void)dismissalTransitionDidEnd:(BOOL)completed {
-    if (completed) {
-//        [self.dimmingView removeFromSuperview];
-    }
-}
-
-// 屏幕旋转调用此方法
-- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
-    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
-    
-    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
-        self.dimmingView.frame = self.containerView.bounds;
-        self.presentedView.frame = [self frameOfPresentedViewInContainerView];
-    } completion:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
-        
-    }];
-}
-
-
-@end