I would like to defined a variable with multiple type, but i fail in this case. I want to use it as UITextfield or UIButton in other way. Please help
struct FieldsModel {
let input: [UITextField, UIButton]
}
I would like to defined a variable with multiple type, but i fail in this case. I want to use it as UITextfield or UIButton in other way. Please help
struct FieldsModel {
let input: [UITextField, UIButton]
}
2
Answers
You can give only 1 type to a variable . The variation in your question is not valid.You can’t assing 1..n datatype to a variable . You can use property of the structure generic . Maybe you want something like that