CustomSegmentedControl icon indicating copy to clipboard operation
CustomSegmentedControl copied to clipboard

Change method is not calling even in your example also

Open Fareeha-Naz opened this issue 2 years ago • 2 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)") } }

Fareeha-Naz avatar Jul 27 '21 07:07 Fareeha-Naz

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

Fareeha-Naz avatar Aug 01 '21 07:08 Fareeha-Naz

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) }
]

canbalkaya avatar Sep 16 '21 07:09 canbalkaya