Swift Tutorial: How to create and use extension in swift ( Email validation example)

Published: 01 January 2019
on channel: Swift Tutorials
1,284
22

In this video, we will learn how to create extension for string class in swift. Extension in swift allows developer to add their code to already existed classes, example String, UIView, UIButton etc.
In this video, we will add function to String class that validates an email address i.e. will return true if email id is in correct format otherwise will return false. We will add valid email function to string class using extension feature of swift language and then use that extended function in our code.