0

I am trying to create number pad in iPad using popover view controller. Everything is achieved but there is a shadow beneath the pop view. I tried to remove that shadow but nothing worked for me. Here is my code which presents pop over view in my view controller.

let vc = self.storyboard?.instantiateViewController(withIdentifier: "PopOverVC") as? PopOverVC
    vc?.modalPresentationStyle = .popover
    vc?.preferredContentSize = CGSize(width: 280, height: 425)
    vc?.delegate = self
    if let popoverPresentationController = vc?.popoverPresentationController {
        popoverPresentationController.permittedArrowDirections = [.down, .up, .right, .left]
        popoverPresentationController.sourceView = self.view
        popoverPresentationController.sourceRect = txtNumber.frame
        popoverPresentationController.delegate = self
        if let popoverController = vc {
            present(popoverController, animated: false, completion: nil)
        }
    }

Here's a screenshot of my pop over view

Can anybody help me removing the shadow? Thanks in advance!!

Sptibo
  • 281
  • 2
  • 8
  • 22
  • Off topic but I think you should keep it since it makes the UI better IMO when the pop over seems to float above the rest of the UI – Joakim Danielson May 05 '22 at 06:47
  • Does this answer your question? [How can I change the opacity of the overlay behind UIPopoverPresentationController?](https://stackoverflow.com/questions/32697436/how-can-i-change-the-opacity-of-the-overlay-behind-uipopoverpresentationcontroll) – LoVo May 05 '22 at 06:51
  • @JoakimDanielson you are right it makes UI better but the text field is slightly dim by that shadow ...that's why I want to remove the shadow. Or reducing shadow radius will be okay...is there any ways? – Sptibo May 05 '22 at 06:54
  • @LoVo I don't think dimming view will help me removing the shadow – Sptibo May 05 '22 at 06:54

0 Answers0