message: Used selectedTab for simplicity
diff: - (void)setTitles:(NSArray<NSString *> *)titles
  {
  - NSInteger selectedIndex = self.selectedSegmentIndex;
  [self removeAllSegments];
  for (NSString *title in titles) {
  [self insertSegmentWithTitle:title atIndex:self.numberOfSegments animated:NO];
  }
  - self.selectedSegmentIndex = selectedIndex;
  + self.selectedSegmentIndex = _selectedTab;
  }
  - (void)setBackgroundColor:(UIColor *)backgroundColor
  