Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- import UIKit
- extension UIViewController {
- open func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, pushing: Bool, completion: (() -> Void)? = nil) {
- if pushing {
- let transition = CATransition()
- transition.duration = 0.3
- transition.type = CATransitionType.push
- transition.subtype = CATransitionSubtype.fromRight
- transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
- view.window?.layer.add(transition, forKey: kCATransition)
- viewControllerToPresent.modalPresentationStyle = .fullScreen
- self.present(viewControllerToPresent, animated: false, completion: completion)
- } else {
- self.present(viewControllerToPresent, animated: flag, completion: completion)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement