Categories: SwiftTutorials

Playing with MRTextField

Hello!

Today I am going to show you guys how to create a line under UITextField using MRTextField and show you some other features of it.

First of all download the repository and drag the class MRTextField in your project or you can use pods to install.

After that drag a UITextField and set its class as MRTextField.

Run your project and you’ll see a line underneath your TextField.

You can customize it further by changing the size of Place Holder and Color of it.
Create an out let of your TextField and set the following properties to it.

        customTextField.textSizePlaceHolder = 20.0
        customTextField.textColorPlaceHolder = UIColor.greenColor()

Left corner and right corner icons can also be added using MRTextField.

        customTextField.iconImage = UIImage(named:"user")
        
        customTextField.dropDown = UIImage(named:"ok")

Need a Square Bracket line? No problem. Just add.

   
   customTextField.style = 1

If you have any question leave a comment and I’ll get back to you asap.
Find sample on Github.
Good Day! 🙂

Aaqib Hussain

Aaqib is an enthusiastic programmer with the love of Swift and anything that looks like Swift i.e Kotlin. He loves writing code in Swift, and exploring new technology and platforms. He likes to listen to old music. When he is not writing code, he's probably spend his time watching movies, tv-shows or anime, or either doing some research for writing the next article. He started Kode Snippets in 2015.

View Comments

Recent Posts

Things to know when moving to Germany

This article covers some important things you must know when you are considering a move…

3 years ago

Unit Testing in Android for Dummies

What is Unit Testing? In its simplest term, unit testing is testing a small piece…

4 years ago

Factory Design Pattern

In this article, you will learn about a type of Creational Design Pattern which is…

5 years ago

Creating Target specific Theme in iOS

In this tutorial, you will go through the use of targets to achieve two separate…

5 years ago

Facade Design Pattern

In this article, you will learn about a type of Structural Design Pattern which is…

5 years ago

Singleton Design Pattern

In this article you will learn about a type of Creational Design Pattern which is…

5 years ago