通过segue将数据从表视图单元传递到选项卡视图控制器子级

时间:2016-05-21 21:49:31

标签: ios swift

我试图找出如何将数据从tapped tableview单元格传递到标签栏视图控制器中的子视图控制器。这就是我目前所拥有的:

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?){

    if segue.identifier == "edit" {

        let cell = sender as! UITableViewCell
        let indexPath = tableView.indexPathForCell(cell)
        let roomController : RoomViewController = segue.destinationViewController as! RoomViewController
        let room : Rooms = frc.objectAtIndexPath(indexPath!) as! Rooms

        roomController.room = room

        }

    }
}

0 个答案:

没有答案