iOS 15 - Assigning unicode character text to UITextField which has isSecureTextEntry as true doesn't work as expected

I am working on a project which has password textfields which is just like OTP text fields, which will allow only one character in a secure text field.

In this there is a support for backspace as well. When the textfield becomes first responder, the unicode character @"\u200B" is added as text of text field.

My problem is, It works fine till iOS 14, but not in iOS 15, the unicode character in secure text field takes it as a character and displays text on text field.

The issue only occurs when the text field allows secure text entry.

Below is the code which I used in demo project to show the issue:

- (void)viewDidLoad {
    [super viewDidLoad];

    [txtUser setSecureTextEntry:false];
    [txt1 setSecureTextEntry:true];

    txtUser.text = @"\u200B";
    txt1.text = @"\u200B";
}

In above code, the txtUser is does not allow secure text entry but txt1 allows secure text entry.

Below are the screenshots of both iOS 14 and 15:

iOS 14 result:

iOS 14 Normal: 

iOS 14 Color blended layers: 

iOS 15 result:

iOS 15 Normal: 

iOS 15 Color blended layers:

I want same result in iOS 15 that is there in iOS 14. I searched for so many solutions, but didn't find the correct one yet!

Thanks!!

iOS 15 - Assigning unicode character text to UITextField which has isSecureTextEntry as true doesn't work as expected
 
 
Q