tungvoduc / DTPagerController

A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.
MIT License
289 stars 42 forks source link

Disable/ Enable segments click #42

Closed hemaks777 closed 5 years ago

hemaks777 commented 5 years ago

Hi , I want to disable the other segments click on first screen and enable it only after the button click on first screen. Could you please tell me how can I do this?

tungvoduc commented 5 years ago

@hemaks777 You can disable segmented control interaction and disable scroll view scrollEnabled.

pageSegmentedControl.isEnabled = false
pageScrollView.isScrollEnabled = false
hemaks777 commented 5 years ago

Hi,

How to disable the click action of segmented control? I have removed the target of segmented control, but still the click is working. Could you please tell me how to disable/enable particular segments based on certain criteria?

tungvoduc commented 5 years ago

@hemaks777 If you use default segmented control, you can do the following:

(pageController. pageSegmentedControl as! UISegmentedControl).setEnabled(: false, forSegmentAt: 0)