I'm using Shinobi Data Grid with my Application. I want to show a simple popover when a row is selected. I try this code below but its not working :
let cell = grid.visibleCell(atCoordinate: gridCoordinate)
let popOver = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "option") as! OptionTableViewController
popOver.modalPresentationStyle = .popover
// let selectedCellSourceView = tableView.cellForRow(at: indexPath)
// let selectedCellSourceRect = cell.bounds
// let sourceView = grid.forBaselineLayout()
// let sourceRect = grid?.layer.bounds
popOver.popoverPresentationController?.delegate = self
popOver.popoverPresentationController?.sourceView = sourceView
popOver.popoverPresentationController?.sourceRect = sourceRect!
popOver.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.left
popOver.preferredContentSize = CGSize(width: 320, height: 88)
self.present(popOver, animated: true, completion: nil)
I have read this and this but none of one of the that reference using Swift. Any answer and suggest will help for me. Thanks in Advance.