I have a tableView
with a UIView
inside it and I want with the tap of a button to disappear the view.
Because the UIView
is inside the tableView
(not as a cell, but above the tableView
) I can't set a height constraint and make it after 0.
This is the code I use:
UIView.animate(withDuration: 2.0, animations: { () -> Void in
self.infoView.frame = CGRect(x: 0 ,y: 0, width: self.view.frame.width, height: 0)
self.view.layoutIfNeeded()
})
I also tried to set infoView equal to nil (but nothing happened)
Please leave a comment if you don't understand something I said.
Thanks in advance.