This class was made in Swift 4 to customize the UINavigationBar gradient.
The properties used were @IBDesignable, so you can change colors through Interface Builder.
To use:
Just add this class to your project. In your storyboard, you will need to select the class from your navigation bar to GradientNavBar.
After that, just go to the attributes inspector and modify the desired colors.
Ps: If you want to use it as UITabBarController, just change "class GradientNavBar: UINavigationBar" to "class GradientNavBar: UITabBarController"