我想在tableView中展开和折叠视图。观看了这个视频:
UNUserNotificationCenterDelegate docs
ishidden = true无法正常工作,因为高度仍在那里
func expandCollapse(sender:UIButton) {
let collapseImage = UIImage(named: "collapse")
let expandImage = UIImage(named: "expand")
let row = sender.tag
let indexPath = NSIndexPath(forRow: row, inSection: 0)
let cell = self.table.cellForRowAtIndexPath(indexPath) as! ArchiveViewCell
if (sender.currentImage == UIImage(named: "expand")) {
sender.setImage(collapseImage, forState: UIControlState.Normal)
cell.moreViewHeight.priority = 1
cell.moreViewHeight.constant = 0
cell.moreView.layoutIfNeeded()
} else {
sender.setImage(expandImage, forState: UIControlState.Normal)
cell.moreViewHeight.priority = 999
cell.moreView.layoutIfNeeded()
}