CNSlideBaseNavigationController.swift
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// CNSlideBaseNavigationController.swift
// metaCode
//
// Created by zx on 2023/10/26.
//
import Foundation
class CNSlideBaseNavigationController: UINavigationController
,UIViewControllerTransitioningDelegate {
var dismissClosure: (()->())?
var cellType:CNLiveHomePageCellType = .course
init(rootViewController: UIViewController,cellType:CNLiveHomePageCellType) {
super.init(rootViewController: rootViewController)
self.cellType = cellType
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
modalPresentationStyle = .custom
transitioningDelegate = self
}
func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return CNUpSlideAnimationTransition(animationType: .present, cellType: self.cellType)
}
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return CNUpSlideAnimationTransition(animationType: .dismiss, cellType: self.cellType)
}
func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
return CNUpSlideCardPresentationController(presentedViewController: presented, presenting: presenting)
}
}