// // 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 () @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)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source { return nil; } // dismiss - (id)animationControllerForDismissedController:(UIViewController *)dismissed { return nil; } @end