Check Mobile App
Read now
Start a Project

Check the Valid String for UITextField (non Emoji) in Swift 4.2 .


Check the Valid String

In Most of App  we use the UITextfield  for getting the value from user like their name , email or other details , some time user will make the entry of emoji so it is not a valid & we have to face lot of issue to restrict this type of string .

In iOS what we can do , we can select the ASCII Keyboard type but it will work only for English  language input but it will not support for other language.

For This what we have to do.

Follow This Steps:

1: First we will take a UITextfield like Firstname

Create a Outlet of this :

@IBOutlet weak var firstNameTextField: UITextField!

2: Take a Submit Button where the user will click & get the Value of Textfield.

Here we will have to check weather the value are empty , valid .

for that write this code.

3: Now write the Extension.



1: In first step we are checking the space character .

2: but in second step we are checking weather the string contains emoji or not




4: Now write this Extension for checking the string contains emoji or not .


5: With the help of this Extension you can verified the string contains emoji or valid emoji or only emoji string .














. . .

Leave a Comment

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

Be the first to comment.


When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

Michael Urresta

Michael Urresta

Talk to Sales


Live Chat
Start a Project

    Message Sent!

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

    Back to Home