Я хочу использовать uitableviewrowaction, чтобы показать popoverview, в котором пользователь может выбрать цвет. Popover отлично работает, когда я выбираю элемент навигации в качестве отправителя. Как только я изменяю отправителя на tableViewCell, фон становится темнее, но popover не будет отображаться. Вот мой кодpopover не будет отображаться при нажатии на ячейку
поповер представлены от нав пункта
uitableviewrowaction
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath
indexPath: NSIndexPath) -> [AnyObject]?
{
var colorRowAction = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: "Color", handler:
{ (action:UITableViewRowAction!, path: NSIndexPath!) -> Void in
self.performSegueWithIdentifier("popoverSegue", sender:self.mainTableViewOutlet.cellForRowAtIndexPath(path))
})
return [colorRowAction, deleteRowAction]
}
подготовиться к Segue
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)
{
if segue.identifier == "popoverSegue" {
colorPopover = segue.destinationViewController as SBColorPopover
colorPopover.modalPresentationStyle =
UIModalPresentationStyle.Popover
colorPopover.popoverPresentationController!.delegate = self
colorPopover.delegate = self
}
Проверьте self.mainTableViewOutlet.cellForRowAtIndexPath (путь) возвращает ноль, и Im не видя, что вы делаете что-либо с отправителем в prepareForSegue – Arbitur
Вы правы, мне пришлось вызвать colorPopover.popoverViewController.sourceRect = sender.frame в режиме подготовки к методу segue. Теперь его работа. Благодарю. – Christian