Yalantis / Segmentio

Animated top/bottom segmented control written in Swift.
https://yalantis.com/
MIT License
2.53k stars 324 forks source link

container view relate to selected index not load correctly for first time when default select segment change ? #110

Closed mehdin13 closed 5 years ago

mehdin13 commented 6 years ago

when specify selected item manually for any index , container view still remain in index 0

FarhanAnsari92 commented 6 years ago

define selected index inside viewDidAppear works like a charm ;)

override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) segmentControl.selectedSegmentioIndex = 0 }

rnkyr commented 5 years ago

hey, @mehdin13!

I've just checked the issue with the example project (changed selectedSegmentioIndex's return value to 1 inside ExampleViewController.swift and it works just fine

please reopen and let me know if I misunderstood your issue

mehdin13 commented 5 years ago

hi @rnkyr. thank you for helping. there is a bug in library.the problem is not index and selected index work fine.the bug is in container. in first time view loaded it's load container that related with index 0 not selected index. you can see that in example project if you give more attention to container view.

mehdin13 commented 5 years ago

it's not closed yet.the problem still remain

andre991 commented 5 years ago

I have the same problem here.

mehdin13 commented 5 years ago

the bug already fixed.update to version 3.3. thank @rnkyr.