uias / Tabman

™️ A powerful paging view controller with interactive indicator bars
https://uias.github.io/Tabman
MIT License
2.87k stars 238 forks source link

When swiped through pages, tab goes under bar view. #590

Closed ghost closed 2 years ago

ghost commented 3 years ago

New Issue Checklist

Issue Description

When swiped through pages, viewController goes under barView. However when tapped on barView, there is no layout issue.

Testing

  1. Swipe right or left on pager
  2. Observe tableView goes under barView.
  3. Often tableView finds correct place but after a delay.
MussaCharles commented 2 years ago

Hi, @hakan-toptal did you fix the mentioned issue?

ghost commented 2 years ago

Hi, @hakan-toptal did you fix the mentioned issue?

Yes, I have resolved the issue as following:

func viewController(for pageboyViewController: PageboyViewController, at index: PageboyViewController.PageIndex) -> UIViewController? {
    pageboyViewController.view.layoutIfNeeded()
    pageboyViewController.view.setNeedsLayout()
    let myViewController = MyViewController()
    myViewController.additionalSafeAreaInsets.top = barView.bounds.height
    return myViewController
}