我有一個隱藏的單元格內的按鈕(PFQueryTableViewController),當用戶執行某個以編程方式調用的Segue時,我想取消隱藏它。如果用戶在swift中執行segue,我將如何取消隱藏按鈕?
當用戶點擊單元格時,它會延伸到一個視圖控制器,該控制器將顯示單元格全屏的內容......我希望按鈕在調用segue時取消隱藏,以便用戶返回到他們可以在他們剛剛點擊的單元格上看到它的單元格表格。
我該怎麼做?問題後
編輯:
內cellRowForIndexPath我已在該按鈕
cell.myButton.tag = indexPath.row
cell.myButton.addTarget(self, action: "pressed:", forControlEvents: UIControlEvents.TouchUpInside)
cell.myButton.hidden = true
而且SEGUE本身攜帶以下從AllPostsTableViewController細胞(存儲在後端解析)對面FullPostViewController信息。該代碼是這樣的(我會打電話的地方取消隱藏在這裏?):
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
self.performSegueWithIdentifier("showFullPost", sender: self)
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showFullPost" {
let indexPath = self.tableView.indexPathForSelectedRow
let fullPostVC = segue.destinationViewController as! FullPostViewController
let object = self.objectAtIndexPath(indexPath)
fullPostVC.post = object?.objectForKey("postContent") as? String
let likeCount = object!.objectForKey("likedBy")!.count
fullPostVC.likesCounted = String(likeCount)
self.tableView.deselectRowAtIndexPath(indexPath!, animated: true)
}
}
你怎麼隱藏這個按鈕? – adolfosrs
你能列出你目前採取的任何步驟嗎? –
我編輯了更多細節!感謝您的回覆 –