Use extension in Swift 3

Updated 19 September 2017

Save

Extension in Swift 3

Using extension is swift is the best part, it saves a lot of time. Like you want to use any feature of UIView, UITextField, UIColor or Any extension of delegates methods. In Swift, you have to create extension anywhere in your project but outside the class like:-

Extensions are usable like you want to set HexaDecimalcode color function that iOS by default not provide and you want to set only bottom border of UITextfield that same iOS by default not provide and it save your lines of code instead of writing code in every class you have to write this method only once in your project example of creating extensions in iOS :-

How to use extension example:-

You can also check the extension of Navigation Bar with gradient

Add Gradient in Navigation Bar using Extension in Swift 3.0

You can also check the extension of UIView

Add Gradient in UIView using Extension in Swift 3.0

 

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home