I have a custom UISlider, but there is a side of the slider which is not rounded
Here my custom view:
class PrimarySliderView: UISlider {
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
setup()
}
override func trackRect(forBounds bounds: CGRect) -> CGRect {
return CGRect(origin: bounds.origin, size: CGSize(width: bounds.width, height: 6))
}
func setup() {
tintColor = .cornFlowerBlue
}
How to round the right side also?
EDIT
The slider is cutted because my application is RTL, when I change to LTR this display correctly but not in RTL, how to resolve this problem?
In My AppDelegate I force RTL:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
UIView.appearance().semanticContentAttribute = .forceRightToLeft
return true
}