PopoverviewController like subview iOS swift
Problem:
I want to show my popoverviewcontroller as my view's subview and tap on outside it wants to be closed.
How can i achieve that?
Solution:
extension MyViewController:UIPo
// MARK: - popoverPresentationController delegate
public func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}
}
func openpopover(_ sender: UIBarButtonItem){
let popController = Storyboard.insta
popController.preferredContent
// set the presentation style
popController.modalPresentatio
popController.popoverPresentat
// set up the popover presentation controller
popController.popoverPresentat
popController.popoverPresentat
popController.popoverPresentat
popController.popoverPresentat
// present the popover
controller.present(
}
Comments
Post a Comment