5

I am trying to create custom transition but I have a problem with "jumping" tableView. As you can see, just before transition, tableView hide under navigationBar which is wrong. How can I fix it? Animation code:

UIView.animate(withDuration: transitionDuration, delay: 0, options: animationOptions, animations: { [weak self] in
        guard let self = self else { return }
        fromVC.view.transform = CGAffineTransform(scaleX: 0.9, y: 0.855)
        fromVC.view.layer.cornerRadius = self.cornerRadius
        fromVC.view.clipsToBounds = true
        self.containerView.frame.origin.y -= self.containerHeight
        self.topView.frame.origin.y -= self.containerHeight
        self.backdropView.alpha = self.backdropAlpha
        }, completion: { _ in
            transitionContext.completeTransition(true)
    })

and how it looks right now: enter image description here

czater
  • 377
  • 4
  • 11
  • The infamous jumping of the table on select has to do with cell heights, not the modal presentation. Look at this for a starting point: https://stackoverflow.com/questions/25937827/table-view-cells-jump-when-selected-on-ios-8 – trndjc Nov 29 '18 at 10:23
  • I checked it all, nothing works : – czater Nov 29 '18 at 11:11
  • Also, if I start the transition without touching the tableView, it still jumps – czater Nov 29 '18 at 11:23
  • 1
    I had that problem also a long time ago and if I remember correctly, it was related to automatic scroll view adjusting. The transformation of the presenting view triggered something in the scroll views automatic adjustment. Tinker with that. – trndjc Nov 29 '18 at 11:45
  • This has nothing to do with UITableView or its cells. You can easily verify that by doing the same transition between two plain UIViewControllers with a single UIView filling the whole screens. The problem is that the height of the navigation bar is bigger when it's at the top of UIWindow, but as soon as iOS detects that navigation bar is no longer contiguous with UIWindow, the height is reduced, and the nav bar is not moved up. The view under the navigation bar does move up though - any type of view. Have you managed to solve that by any chance? – NeverwinterMoon Mar 15 '19 at 21:38

0 Answers0