How to use PartiallyEditField and features – ios

Are you looking for some things like that slack login field behavior. In slack when you entering sub domain , only subdomain will be change. but domain name (“”) will not change. it means thats non editable. It means edit will be available partially.

see the following gif to get the idea.


Okay now you have clear idea…

If you want to implement that you add label for non editable text and add uitextfield for editable text.
that’s not good practice and, to develop by your self take some times. So now you have an options. thats PartiallyEditField.

PartiallyEditField library will help to you.


How to use ?


This need uikit that’s only thing you need.

How to apply to Xcode project

Downloading Source Code
Download PartiallyEditField from gitHub
Add required frameworks

import "PartiallyEditField.h"

to your source code file
Using CocoaPods

pod "PartiallyEditField"

If you are new to CocoaPods, please go to Wiki page.

constant sample for left side

[_leftPreTxtField setupWithPreText:@"" color:[UIColor redColor]];

constant sample for right side

[_rightPreTxtField setupWithPreText:@"www." color:[UIColor redColor]];
_rightPreTxtField.preTextSide = kLeft;

IF you want to change placeholder color that one also available for this library.

_rightPreTxtField.placeHolderColor = [UIcolor blueColor];

That’s it.

The good things still you can access UITextField method and features. Because that’s inherit from UITextField

You can select side for the non editable text

_rightPreTxtField.preTextSide = kLeft;

It’s défault for kLight (for right side)

What are the concerns
For now you cann’t add attributed text for non editable text. Actually i have developed that feature also but got one issue when I implement it. I will add that feature in future. Currently its developing stage.

The issue was When user delete may text when it blank (when place holder display) all the text boxes touch events will be gone.

Write a Reply or Comment

Your email address will not be published.