2
var popVC:UIPopoverController?
popVC = UIPopoverController(contentViewController: viewControl)
popVC?.delegate = self
popVC?.setContentSize(highlight!.frame.size, animated: false)
highlight?.popVC = popVC
if let dir = self.phData.direction {
        var popDir = UIPopoverArrowDirection.any
        switch dir {
        case "left":
            popDir = UIPopoverArrowDirection.left
            break
        case "right":
            popDir = UIPopoverArrowDirection.right
            break
        case "top":
            popDir = UIPopoverArrowDirection.up
            break
        case "down":
            popDir = UIPopoverArrowDirection.down
            break
        default:
            break
        }
        popVC?.present(from: self.frame, in: inView, permittedArrowDirections: popDir, animated: true)
  }else{
        popVC?.present(from: self.frame, in: inView, permittedArrowDirections: UIPopoverArrowDirection.any, animated: true)
    }

The above code is deprecated and now I want to change it to UIPopoverPresentationController. I tried searching the answers but then the answer was not suitable for the NSObject subclass so I am confused. Please help me. Thanks in advance.

tamizhachi_
  • 65
  • 10

0 Answers0