I agree with Fogmeister for text fields that were created in code. But if you put text fields in the Storiesboard, this approach will not work (since each field explicitly defines its properties). But there is an easy way that really works.
Right-click on your storyboard and "Open As .." Source Code. This puts the SB XML view in the editor window. There you can change the properties of the text field globally (and / or selectively) using the editor (or copy to the XML editor of your choice).
A fair warning, you can kill your project if you introduce errors in the SB that will not allow it to compile, so be very careful and make sure that you have a backup for your SB. But if you check after each change, this method may work very well.
Search for " <textField " to find something like this:
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="name" minimumFontSize="17" clearButtonMode="whileEditing" id="F9N-Tb-KTd"> <rect key="frame" x="176" y="301" width="472" height="31"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits" autocapitalizationType="words" enablesReturnKeyAutomatically="YES"/> <connections> <action selector="changeName:" destination="4" eventType="editingDidEnd" id="bLg-iM-m8a"/> </connections> </textField>
Find one text box that has fontDescription properties that you like and one that doesn't. Then replace the fontDescription properties you want to change with the appropriate properties from the good. Remember to limit your changes to things like font, size and background. Do not change id, rect or anything else that should be unique to the text field.
I hope this works for you, it was a very convenient technique for me to make sure that all of my text fields have consistent typography.
(To return to normal view, "Open As ..." Interface Builder - Storyboard)
Good luck
source share