Extensions in Swift 3.0
As the previous post I explained Protocol . So What's new here? Today I wrote about Extensions, very powerful in swift. Extensions :- I f you are familiar with objective c “Category” then digest this swift concept is simple. It serves the almost same purpose. Extensions allow us to add additional functionality to an existing class structure and enum type. Which adds the power of extends type for which class you do not have access to original source code, the process know as Retroactive Modelling. We use “extension” keyword to create the extension. extension TestClass { } Note that to define extensions , we use the extension keyword followed by the type we would like to extend. Even we can create the extension inbuilt class, String, Array, etc. Extensions Functionalities: Extensions with Protocol conformance:- you can extend an existing ‘type’ to adopt and just to conform new protocol even you...