How to convert HEX colors to UIColor in Swift 5?
There are many situations when you want to create an UIColor object from a hex color string. In this post, we provide a code sample that will help you convert hex colors to UIColor objects. While generally, you can get away with this by manually converting the hex code to RGB (using an online converter, for example), there are scenarios where your colors are dynamic, so you'll need a utility method that converts the hex code to an RGB color in Swift 5.