Commit ecaa746404f2080eafff90651e5a6e8f56f023e9

Authored by “张旭”
1 parent 3a35e20a

更改转场动画消失的效果

metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomePageAnimationTransition.swift
@@ -69,12 +69,12 @@ extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { @@ -69,12 +69,12 @@ 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 - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { 72 + 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) 73 let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view)
74 fromVC.view.frame = frame 74 fromVC.view.frame = frame
75 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius 75 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius
76 fromVC.closeBtn.alpha = 0 76 fromVC.closeBtn.alpha = 0
77 - 77 + fromVC.tableView.alpha = 0
78 }) { (completed) in 78 }) { (completed) in
79 transitionContext.completeTransition(completed) 79 transitionContext.completeTransition(completed)
80 } 80 }
metaCode/Classes/Main/Util/CNUpSlideAnimationTransition.swift
@@ -151,26 +151,26 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { @@ -151,26 +151,26 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning {
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 153
154 - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { 154 + 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) 155 let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view)
156 fromVC.view.frame = frame 156 fromVC.view.frame = frame
157 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius 157 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius
158 fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width 158 fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width
159 fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height 159 fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height
160 fromVC.closeBtn.alpha = 0 160 fromVC.closeBtn.alpha = 0
161 - 161 + fromVC.tableView.alpha = 0
162 }) { (completed) in 162 }) { (completed) in
163 transitionContext.completeTransition(completed) 163 transitionContext.completeTransition(completed)
164 } 164 }
165 }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ 165 }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{
166 guard let selectedCell = toVC.selectedDuanjuCell else { return } 166 guard let selectedCell = toVC.selectedDuanjuCell else { return }
167 let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController 167 let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController
168 - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { 168 + 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) 169 let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view)
170 fromVC.view.frame = frame 170 fromVC.view.frame = frame
171 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius 171 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius
172 fromVC.closeBtn.alpha = 0 172 fromVC.closeBtn.alpha = 0
173 - 173 + fromVC.tableView.alpha = 0
174 }) { (completed) in 174 }) { (completed) in
175 transitionContext.completeTransition(completed) 175 transitionContext.completeTransition(completed)
176 } 176 }
@@ -185,14 +185,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { @@ -185,14 +185,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning {
185 guard let selectedCell = toVC.selectedCell else { return } 185 guard let selectedCell = toVC.selectedCell else { return }
186 let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController 186 let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController
187 187
188 - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { 188 + 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) 189 let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view)
190 fromVC.view.frame = frame 190 fromVC.view.frame = frame
191 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius 191 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius
192 fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width 192 fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width
193 fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height 193 fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height
194 fromVC.closeBtn.alpha = 0 194 fromVC.closeBtn.alpha = 0
195 - 195 + fromVC.tableView.alpha = 0
196 }) { (completed) in 196 }) { (completed) in
197 transitionContext.completeTransition(completed) 197 transitionContext.completeTransition(completed)
198 } 198 }
@@ -205,14 +205,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { @@ -205,14 +205,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning {
205 guard let selectedCell = toVC.selectedCell else { return } 205 guard let selectedCell = toVC.selectedCell else { return }
206 if fromNaviVC.topViewController is CNUpSlideDetailViewController{ 206 if fromNaviVC.topViewController is CNUpSlideDetailViewController{
207 let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController 207 let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController
208 - UIView.animate(withDuration: transitonDuration - 0.3, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { 208 + 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) 209 let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view)
210 fromVC.view.frame = frame 210 fromVC.view.frame = frame
211 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius 211 fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius
212 fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width 212 fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width
213 fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height 213 fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height
214 fromVC.closeBtn.alpha = 0 214 fromVC.closeBtn.alpha = 0
215 - 215 + fromVC.tableView.alpha = 0
216 }) { (completed) in 216 }) { (completed) in
217 transitionContext.completeTransition(completed) 217 transitionContext.completeTransition(completed)
218 } 218 }