- Single library to show popovers in both iPhones & iPads
- One line usage with easy integration
- Works on iPhone portrait and landscape mode as well
Right now FAPopover is only supported via swift package manager. You can also install it manually. Just drag source folder files into your project and you're all set.
Conform the controller with PopoverPresentable
protocol and provide CGSize
for the controller
In viewWillAppear
set the preferredContentSize = preferredContentsizeForPopover()
In viewWillAppear
set the navigationController?.preferredContentSize = preferredContentsizeForPopover()
Following are some examples of how you can use FAPopoverManager,
@IBAction func showSingleControllerInPopover(_ sender: UIButton) {
let testViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(identifier: "TestTableViewController")
FAPopoverManager.show(testViewController, arrow: .up, sourceRect: sender.bounds, sourceView: sender)
}
@IBAction func showNavigationalPopover(_ sender: UIButton) {
let testViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(identifier: "TestTableViewController")
let navigationController = UINavigationController(rootViewController: testViewController)
FAPopoverManager.show(navigationController, arrow: .up, sourceRect: sender.bounds, sourceView: sender)
}
@IBAction func showSingleControllerInFromUIBarButtonItem(_ sender: UIBarButtonItem) {
let testViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(identifier: "TestTableViewController")
let navigationController = UINavigationController(rootViewController: testViewController)
FAPopoverManager.showFromBarButtonItem(navigationController, arrow: .up, sourceView: sender)
}
InteractiveView is licensed under MIT.
For more details visit the LICENSE file for more info.
Fahid Attique - (https://github.com/fahidattique55)