I am tired of setting property values to each UILabel
in the IB. Is extending the UILabel
the only possible way? or there exists some other way to do it?
This applies to all the widgets in storyboard/xib.
Also as @dehlen metioned,
If you are using codebase for UI then, Custom Button Class
CustomButton
CustomButton
Thanks @dehlen, You are right, I forgot to mention code side implementation.
You could create an IBOuletCollection
for the labels and set the properties programmatically (in viewDidLoad
for example) using:
[self.outletCollection setValue:whatever forKey:something];
You can also call makeObjectsPerformSelector
on the collection in order to send messages to each label.
After setting the property of a UILabel make copy of it by
Press and hold alt and drag and drop UILabel to another place it will create new copy of that UILabel with same properties.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.