| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- //
- // 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
|