ARSPopover
ARSPopover copied to clipboard
How to dismiss popover?
How to dismiss popover? There is no property to dismiss the popover If I need to dismiss it after the UITableView Row selection inside popover.
Hello @imuhammadjabbar , Please find below an answer to your question
self.present(popoverController, animated: true) {
popoverController.insertContent(intoPopover: { (popover, popoverPresentedSize, popoverArrowHeight) in
// 1. init
let button = UIButton(type: .roundedRect)
button.setTitle("Close", for: .normal)
button.sizeToFit()
button.center = CGPoint(x: 50, y: 25)
// 2. action => popover!.close is a function that exist in ARSPopover
button.addTarget(popover, action: #selector(popover!.close), for: .touchUpInside)
// 3. add to view
popover?.view.addSubview(button)
})
}
@objc func close() {
self.dismiss(animated: true)
}