selects segment according to selected view controller index