0

enter image description here

I am designing an option bar on the navigation bar of my app, I want to achieve the same UI of that of the Music App, as you can see when the slider is sliding, the UILabel is partially changing its color, how does this be archived? Should I work on CALayer?

This is what I did so far, it's just not correct

UIView.animate(withDuration: 0.3, delay: 0, options: .curveEaseOut, animations: {
        
            self.optionBarSlider.frame = self.selectedButton.frame
        }) { _ in
            self.selectedButton.setTitleColor(.black, for: .normal)
        } 
Zim
  • 674
  • 7
  • 15

1 Answers1

0

You can do this with setting attributedText to change the color of the portion that you need

How do you set an Attributed Title Color for State in Swift

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87