I am fairly new to Swift. I am writing an iPad app that has a number of UITextFields on the screen and I want to write one function that changes the properties of any of the text fields. I am hoping the function can get the name (or some other identifier) of the field to change from a parameter or pick it up from a variable. Is this possible? If so, what would be the syntax of the code to change a property, e.g. background colour, where the text field name is not 'hard coded' in the instruction?
In other words, a 'hard coded' instruction could be mytextfield.backgroundColor = UIColor.lightGrayColor(). I want to include this in a function where the field name in this instruction is variable.
Note that the text field will not necessarily be the 'first responder' when the function is called.
My apologies if this is a dumb question but I have spent hours reading docs and searching forums and cannot find an answer. Thanks.