title: iOS UISLider with gradient layer
body: <p>I'm building an iOS application in which I have to implement a custom UISlider. The problem is that the built-in UISlider doesn't support gradient track. Another issue is my UI style guide shows that the current tracking value rectangle should be a gradient of two colors as shown in the image </p>
  
  <p><a href="https://i.stack.imgur.com/1pebL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1pebL.png" alt="enter image description here"></a></p>
  
  <p>How can I build a customized version of the UISlider? I have thought of either subclassing the existing one or by building a UIControl subclass.</p>
  
  <p>I'm using xcode 9.4 and swift 4.2</p>
  
  <p>Thanks in advance!</p>