Read More

Add Gradient in UIView using Extension in Swift 3.0

UIView Extension of Gradient

The extension is a great concept in swift in swift you can add your function is already predefined classes in swift 3.0 like String, UIView, UIColor etc.A while creating an extension you can write it anywhere in your project.To create a gradient extension you have to create an extension of UIView class.The main benefit of extension is that it will reduce many of your code lines like you have to use the gradient 5 times in your project so you have to write the same code 5 times in your project while creating an extension you have to write it only once it will also save the application memory.Example to create an extension:-

how to use Extension:- 

Add Transparency To GRADIENT:-

If you want to add transparency to the gradient, then you have to change the alpha of your colors:-

 

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close