faganello60 / CustomSegmentedControl

Create a Custom Segmented Control to your iOS App

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change method is not calling even in your example also

Fareeha-Naz opened this issue · comments

Change method is not calling even in your example also.... i have been added added delegate in view controller class also but change method is not call. please help as soon as possible... my class delegation is like that

class WifiWatchViewController: UIViewController, CustomSegmentedControlDelegate {

func change(to index:Int) {
print("segmentedControl index changed to (index)")
}
}

please update me otherwise i have to change my solution....... its my request

Same issue.

I added an array of type () -> Void inside the segmented control element in order to take actions when the index changes:

flatSegmentedControl.actions = [
    { self.setViewControllers([self.viewControllerList[0]], direction: .reverse, animated: true, completion: nil) },
    { self.setViewControllers([self.viewControllerList[1]], direction: .forward, animated: true, completion: nil) }
]