I'm trying to make a UITableView
that can support having different objects/elements inside it. Specifically, these elements are a UITextField
and UISwitch
.
The first problem:
The elements do not show up. They are placed in the prototype cell
, which is then constructed inside the class
I have set up. I have verified that the cell
setup is working because I can change the words on each cell
, but there are no elements within the cell
.
Here is the code that constructs my cells right now:
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int{
return 1
}
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{
let cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier: "EmailCell")
return cell
}
Second problem (which might be solved along with the first):
I have no way of accessing the information in each UITextField
or each UISwitch
. How can I get this information from all cells that exist?
Thanks in advance for the help!