I'm new to iOS programming. I want to create a progress bar with a UIlabel which also change text color according to background color like this: 
Please don't mark the question as duplicate. Because the solution I found are in Obj C or some Pods. But I wanted the solution in Swift because I didn't have any knowledge about Obj-C.
Thanks!
If you want an answer in swift, here is the code(changed from objc to swift) from this post, which should be exactly what you need:
This is swift 4
Tested with playground