Commit dfe5ed8e08e9524eb62149a22dd20dc162e7a474
1 parent
9d95b889
取消 区块dismiss动画
Showing
2 changed files
with
8 additions
and
3 deletions
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomePageAnimationTransition.swift
| @@ -69,12 +69,14 @@ extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -69,12 +69,14 @@ extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 69 | if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | 69 | if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ |
| 70 | guard let selectedCell = toVC.selectedDuanjuCell else { return } | 70 | guard let selectedCell = toVC.selectedDuanjuCell else { return } |
| 71 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController | 71 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController |
| 72 | + | ||
| 73 | + fromVC.view.isHidden = true | ||
| 72 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 74 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 73 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) | 75 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) |
| 74 | fromVC.view.frame = frame | 76 | fromVC.view.frame = frame |
| 75 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius | 77 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius |
| 76 | fromVC.closeBtn.alpha = 0 | 78 | fromVC.closeBtn.alpha = 0 |
| 77 | - fromVC.tableView.alpha = 0 | 79 | + |
| 78 | }) { (completed) in | 80 | }) { (completed) in |
| 79 | transitionContext.completeTransition(completed) | 81 | transitionContext.completeTransition(completed) |
| 80 | } | 82 | } |
metaCode/Classes/Main/Util/CNUpSlideAnimationTransition.swift
| @@ -150,6 +150,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -150,6 +150,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 150 | if fromNaviVC.topViewController is CNUpSlideDetailViewController{ | 150 | if fromNaviVC.topViewController is CNUpSlideDetailViewController{ |
| 151 | guard let selectedCell = toVC.selectedCell else { return } | 151 | guard let selectedCell = toVC.selectedCell else { return } |
| 152 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | 152 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 153 | + fromVC.view.isHidden = true | ||
| 153 | 154 | ||
| 154 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 155 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 155 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | 156 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| @@ -158,13 +159,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -158,13 +159,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 158 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width | 159 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width |
| 159 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height | 160 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height |
| 160 | fromVC.closeBtn.alpha = 0 | 161 | fromVC.closeBtn.alpha = 0 |
| 161 | - fromVC.tableView.alpha = 0 | 162 | + |
| 162 | }) { (completed) in | 163 | }) { (completed) in |
| 163 | transitionContext.completeTransition(completed) | 164 | transitionContext.completeTransition(completed) |
| 164 | } | 165 | } |
| 165 | }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ | 166 | }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ |
| 166 | guard let selectedCell = toVC.selectedDuanjuCell else { return } | 167 | guard let selectedCell = toVC.selectedDuanjuCell else { return } |
| 167 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController | 168 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController |
| 169 | + fromVC.view.isHidden = true | ||
| 168 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 170 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 169 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) | 171 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) |
| 170 | fromVC.view.frame = frame | 172 | fromVC.view.frame = frame |
| @@ -184,7 +186,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -184,7 +186,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 184 | guard let toVC = transitionContext.viewController(forKey: .to) as? CNUpSlideViewController else { return } | 186 | guard let toVC = transitionContext.viewController(forKey: .to) as? CNUpSlideViewController else { return } |
| 185 | guard let selectedCell = toVC.selectedCell else { return } | 187 | guard let selectedCell = toVC.selectedCell else { return } |
| 186 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | 188 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 187 | - | 189 | + fromVC.view.isHidden = true |
| 188 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 190 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 189 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | 191 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| 190 | fromVC.view.frame = frame | 192 | fromVC.view.frame = frame |
| @@ -205,6 +207,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | @@ -205,6 +207,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { | ||
| 205 | guard let selectedCell = toVC.selectedCell else { return } | 207 | guard let selectedCell = toVC.selectedCell else { return } |
| 206 | if fromNaviVC.topViewController is CNUpSlideDetailViewController{ | 208 | if fromNaviVC.topViewController is CNUpSlideDetailViewController{ |
| 207 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController | 209 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 210 | + fromVC.view.isHidden = true | ||
| 208 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { | 211 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 209 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) | 212 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| 210 | fromVC.view.frame = frame | 213 | fromVC.view.frame = frame |