Ios/swift/TableView/画面遷移
TableViewで表示されたCellをクリックした後に画面遷移させる方法
Navigationを使った場合のサンプル
// Cell が選択された場合
func tableView(table: UITableView, didSelectRowAtIndexPath indexPath:NSIndexPath) {
_selectedId = self._imgs[indexPath.row].id
if _selectedId != nil {
let appDelegate:AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
let detailViewController = storyboard.instantiateViewControllerWithIdentifier("DetailViewControllerId") as! DetailViewController
detailViewController.selectedId = self._selectedId
appDelegate.navigationController?.pushViewController(detailViewController, animated: false)
}
}