iOS UITextfield disable editing for typing swift

Solution:

1. Set the textfield inputview to UIView and set the user interaction to be enabled.

2. If you set the user interaction disabled you cannot be able to change the text as bold font style and change the background color.


        myTxtField.inputView = UIView()


If you want to change that to disable then use the below code


        myTxtField.inputView = nil

Comments

Post a Comment

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift