【发布时间】:2015-12-09 17:57:00
【问题描述】:
我想将 SWRC 菜单上按下的项目的标题传递为 sw_front 导航栏的标题
所以两个 VC : 1 侧菜单“sw_rear” 2-前端VC“sw_front”
class menuVC: UITableViewController {
var menu = ["Title1","Title2","Title3"]
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
// Configure the cell...
cell.textLabel?.text = menu[indexPath.row]
func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "Pushitem"
{
if let destinationVC = segue.destinationViewController as? frontVC{
destinationVC.NavBar.topItem?.title = menu[indexPath.row]
}
}
}
return cell
}
【问题讨论】:
标签: ios iphone swift segue swrevealviewcontroller