Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSimen Anthonsen
1,097 PointsAdd a property to an UITextfield
Is there a way to "add" a property to the UITextfield?
1 Answer
Richard Lu
20,185 PointsHi Simen,
I believe you can add a computed property onto UILabel by using extensions. If you're creating a custom UITextfield, maybe you could try subclassing it.
// Here's an example using extensions
extension UITextfield {
var someProperty: SomeType {
get { }
set { }
}
}
Good luck! :)
Simen Anthonsen
1,097 PointsSimen Anthonsen
1,097 PointsThanks!