I am presenting my viewController like so using accessoryButtonTappedForRowWith
:
let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let popoverContent = storyboard.instantiateViewController(withIdentifier: "Test")
popoverContent.modalPresentationStyle = .popover
if let popover = popoverContent.popoverPresentationController {
let viewForSource = self.createCharacterView as UIView
popover.sourceView = viewForSource
// the position of the popover where it's showed
popover.sourceRect = viewForSource.bounds
// the size you want to display
popoverContent.preferredContentSize = CGSize(width: 200,height: 200)
popover.delegate = self
}
self.present(popoverContent, animated: true, completion: nil)
The pop up works and looks fine it's just that the viewController that I am presenting needs to the label of the tableViewCell. I am able to get the variable, but I'm unsure how to pass the variable to the popover since a segue isn't called I don't think I am able to use prepare(for segue: UIStoryboardSegue, sender: Any?)
.