//Show Popover
myViewController.modalPresentationStyle = .Popover
//From UIButton
let popoverController = myViewController.popoverPresentationController
popoverController?.sourceView = cell
popoverController?.sourceRect = button.frame
popoverController?.permittedArrowDirections = .Any
self.presentViewController(myViewController, animated: true, completion: nil)
//From BarButtonItem
let popoverController = vcTableOptions.popoverPresentationController
popoverController?.sourceView = self.view
popoverController?.barButtonItem = self.barBtnActions
popoverController?.permittedArrowDirections = .Any
self.presentViewController(vcTableOptions, animated: true, completion: nil)
New way to show popover on iPad
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.