I am new to iOS development and therefor doesn't have a lot of knowledge. Here is the problem I have.
Inside my View Controller, I have a table View that allows the user to delete rows. When all the rows have been deleted, a view should appear. Everything works perfectly, once all the rows are removed the view appears but when the view controller is launched the tableView and the views appears together, the view only disappears once the user starts to delete rows of the table view.
Here is the function :
private func showView() {
if panier.isEmpty {
viewEmptyBasket.isHidden = false
tableView.isHidden = true
} else {
viewEmptyBasket.isHidden = true
}
}
any idea how to fix this ? And only have the table View appears on screen when launching the controller ?
Thanks !!
you need to call showView() function inside veiwDidLoad()
and to set tableView.isHidden = false when the panier is not Empty ,also it will be better to make this UIchanging inside the main queue