GocePetrovski / ScrollableSegmentedControl

Scrollable Segmented Control for when UISegmentedControl is not sufficient
MIT License
245 stars 74 forks source link

Default Selected Index Issue #13

Closed cwestMobile closed 6 years ago

cwestMobile commented 6 years ago

So the only way I've been able to get the default selected index to actually highlight is by putting it in viewWillAppear, but I'd rather not do that. It is not working in viewDidLoad where I want it to.

Ideas?

GocePetrovski commented 6 years ago

This works just fine. See Demo project and try changing line 39 of TableViewController.swift from segmentedControl.selectedSegmentIndex = 0 to say segmentedControl.selectedSegmentIndex = 2