0

how to set itemInfo text from string file xlpagertabstrip child title

 override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
            **let path = Bundle.main.path(forResource: "String" , ofType: "plist")
            let dict = NSDictionary(contentsOfFile: path!)
            let Data = dict?.object(forKey: "Main_Menu_Title") as! [String]
            let child_1 = HomeViewController(itemInfo: Data[0] )**
            let child_2 = SectraitViewController(itemInfo: "Home")
            let child_3 = InfrastructureViewController(itemInfo: "Home")
            let child_4 = TourismViewController(itemInfo: "Home")
            let child_5 = HomeViewController(itemInfo: "Home")

            guard isReload else {
                return [child_1, child_2, child_3, child_4, child_5]
            }

1 Answers1

0

As mentioned in the readme on github you need to add the IndicatorInfoProvider protocol to your child view controllers. Besides that need to copy and paste the function indicatorInfo into every child class.

The result will look something like:

class YourChildClass: YourViewController, IndicatorInfoProvider {

  // ... Your code here ...

  // MARK: - IndicatorInfoProvider

  func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
    return IndicatorInfo(title: itemInfo)
  }
}