我的表格视图包含每个单元格的详细信息按钮。当我单击该按钮时,它将转到有关该单元格的详细信息页面。在详细信息页面中,有一个“后退”按钮。当我单击它时,它可以返回到表视图,但重新加载表视图。我的问题是如何在不重新加载表格视图的情况下返回。我只想回到单击详细信息按钮的单元格。
谢谢, 贝
TableViewController
override func viewDidLoad() {
super.viewDidLoad()
let theWidth = view.frame.size.width
let theHeight = view.frame.size.height
resultsTable.frame = CGRectMake(0, 0, theWidth, theHeight)
// Do any additional setup after loading the view.
refresher = UIRefreshControl()
refresher.tintColor = UIColor.blackColor()
refresher.addTarget(self, action: "refresh", forControlEvents: UIControlEvents.ValueChanged)
self.resultsTable.addSubview(refresher)
}
Detailviewcontroller
class ProductDetailViewController: UIViewController {
@IBOutlet weak var labelTitle: UILabel!
var labelTitleText = String()
override func viewDidLoad()
{
super.viewDidLoad()
labelTitle.text = labelTitleText
}
@IBAction func backButtonTapped(sender: AnyObject) {
self.dismissViewControllerAnimated(true, completion: nil)
}
}