subinspathilettu / SJSegmentedViewController

MIT License
334 stars 126 forks source link

Change Unselected TitleColor #32

Closed shripadkulkarnid closed 7 years ago

shripadkulkarnid commented 7 years ago

When i select title it change color.But When i select next title previous color remains same.How to change that one title color?Please Reply ASAP

subinspathilettu commented 7 years ago

Hi @shripadkulkarid

Please update pod to latest version, pod ’SJSegmentedScrollView’, ‘1.3.5' and extendSJSegmentedViewControllerDelegate -> func didMoveToPage(controller: UIViewController, segment: SJSegmentTab?, index: Int) function.

eg:-


var selectedSegment: SJSegmentTab?

func didMoveToPage(_ controller: UIViewController, segment: SJSegmentTab?, index: Int) {
        if selectedSegment != nil { //previous segment
            selectedSegment?.titleColor(.lightGray)
        }
        if segments.count > 0 {
            selectedSegment = segments[index]
            selectedSegment?.titleColor(.red)
        }
    }
shripadkulkarnid commented 7 years ago

Thx it will help me.....