@@ -376,49 +376,16 @@ class MessageListViewController: BaseViewController<MessageListViewModel> {
376376 return
377377 }
378378
379- DispatchQueue . main. async { [ weak self] in
380- guard let self else { return }
381-
382- let visibleCells = self . prepareInitialVisibleCellsAnimation ( )
383- UIView . animate (
384- withDuration: 0.26 ,
385- delay: 0 ,
386- options: [ . beginFromCurrentState, . curveEaseOut]
387- ) {
388- self . initialLoadingView. alpha = 0
389- } completion: { _ in
390- self . initialLoadingView. removeFromSuperview ( )
391- }
392-
393- for (index, cell) in visibleCells. enumerated ( ) {
394- UIView . animate (
395- withDuration: 0.5 ,
396- delay: 0.06 + Double( index) * 0.035 ,
397- usingSpringWithDamping: 0.9 ,
398- initialSpringVelocity: 0.12 ,
399- options: [ . beginFromCurrentState, . curveEaseOut]
400- ) {
401- cell. alpha = 1
402- cell. transform = . identity
403- }
404- }
379+ UIView . animate (
380+ withDuration: 0.26 ,
381+ delay: 0 ,
382+ options: [ . beginFromCurrentState, . curveEaseOut]
383+ ) {
384+ self . initialLoadingView. alpha = 0
385+ } completion: { _ in
386+ self . initialLoadingView. removeFromSuperview ( )
405387 }
406388 }
407-
408- private func prepareInitialVisibleCellsAnimation( ) -> [ UITableViewCell ] {
409- tableView. layoutIfNeeded ( )
410-
411- let visibleCells = tableView. indexPathsForVisibleRows?
412- . sorted ( )
413- . compactMap { tableView. cellForRow ( at: $0) } ?? [ ]
414-
415- for cell in visibleCells {
416- cell. alpha = 0
417- cell. transform = CGAffineTransform ( translationX: 0 , y: 10 )
418- }
419-
420- return visibleCells
421- }
422389}
423390
424391extension MessageListViewController : UITableViewDelegate {
0 commit comments