0

I am going to detect the swiping or selecting tab event in XLPagerTabStrip library in Swift 4. I only need to get the tab index whenever selected tab is changed. So I have checked library in Github but not found any good solutions.

thanks.

Bolek.N
  • 71
  • 2
  • 7

1 Answers1

3

So I didn't find a solution from the library itself but, I used viewWillDisappear and for every time you swipe away of the view this function will be called. Should be written as follows in your child view controller:

override func viewWillDisappear(_ animated: Bool) {
    //Do your thing here
}

You can read more about this callback function here.

Moaaz Ali
  • 73
  • 14