Good day, I would like a button outside my table view that would trigger showing the table view (TableView text blank at first, then for it to show after I click the action button). All of this happens in the same view controller. This is my code for the TableView:
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return postData2.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath)
-> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "PostCell2")
let label1 = cell?.viewWithTag(1) as! UILabel
label1.text = postData2[indexPath.row]
return cell!
}
As you can see, I have a label there too for formatting purposes. I don't know if it will affect the triggering of the text. Here's the code for my empty action button:
@IBAction func button2(_ sender: Any)
{
}
Thanks.