123456789101112131415161718192021222324252627282930313233343536373839 |
- import UIKit
- class FFTransitioning: NSObject, UIViewControllerTransitioningDelegate {
- private let alertStyle: FFAlertStyle
- init(alertStyle: FFAlertStyle) {
- self.alertStyle = alertStyle
- }
- func presentationController(forPresented presented: UIViewController,
- presenting: UIViewController?, source: UIViewController)
- -> UIPresentationController? {
- return FFPresentationController(presentedViewController: presented, presenting: presenting)
- }
- func animationController(forPresented presented: UIViewController,
- presenting: UIViewController, source: UIViewController)
- -> UIViewControllerAnimatedTransitioning? {
- if self.alertStyle == .actionSheet {
- return nil
- }
- return FFAnimationTransitioning(presentation: true)
- }
- func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
- return self.alertStyle == .alert ? FFAnimationTransitioning(presentation: false) : nil
- }
- }
|