1
Я хочу передать название прессованного пункта меню SWRC быть заголовком панели навигации sw_frontSwift: SEGUE имени ТЕСЬМЫ пункта меню на названии навигации бара с SWRevealViewController
Так два VC: 1 сторона меню "sw_rear" 2- передняя ВК "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
}
Xcode предложить добавить переопределение prepareForSegue то после этого он выходит из строя> Фатальная ошибка: неожиданно обнаружили, nil во время разворачивания необязательного значения>, указываемого на destinationVC.NavBar.topItem? .title = menu [indexPath.row] – marrioa
попробуйте что-то вроде 'var title = menu [indexPath.row]', затем назначьте заголовок целевому заголовку – Lamar
Я сделал, но didn Не работайте, пожалуйста, если вы посмотрите https://www.dropbox.com/s/16wd7l8fjj6ulf2/TwoSWRE.zip?dl=0 – marrioa