通常,我会这样改变 View :
var goBackToMainView:MainViewController = self.storyboard?.instantiateViewControllerWithIdentifier("navigation2") as MainViewController
self.presentViewController(goBackToMainView, animated: true, completion: nil)
但是,如果我在用户点击按钮时尝试在我的自定义 UITableViewCell 中执行此操作,则会出现错误,例如 customTableViewCell does not have a member named 'storyboard' and 'presentViewController'
如何更改 TableViewCell 中的 View ?
最佳答案
您是否尝试过添加为 subview ?
例子:
var tableViewCell = UITableViewCell(frame: aFrame)
tableViewCell.addSubview(aView)
关于uitableview - 在自定义 UITableViewCell 中点击按钮时如何更改 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27534506/