-1

Want to make like this

that is my code to present lookup

  let vc = self.storyboard?.instantiateViewController(withIdentifier: "EmployeeLookUpVC") as! EmployeeLookUpVC

        self.present(vc, animated: true, completion: nil)
Ganesa Vijayakumar
  • 2,422
  • 5
  • 28
  • 41
Mohamed Fouad
  • 74
  • 1
  • 9

2 Answers2

0

Give Transparent color to the super view of EmployeeLookUpVC.

Gowri G
  • 420
  • 4
  • 18
0

Swift 5

Add this code snippet from where you want to lunch popup.

let popupViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: “PopupViewController") as? PopupViewController

let window = UIApplication.shared.keyWindow

//You can set the background color as you want
popupViewController!.view.backgroundColor = UIColor.init(red: 0.0/255.0, green: 0.0/255.0, blue: 0.0/255.0, alpha: 0.6) 

popupViewController!.view.frame = (window?.frame)!
window?.addSubview(popupViewController!.view)
window?.rootViewController?.addChild(popupViewController!)

popupViewController!.didMove(toParent: self)

Add this code snippet on the popup close button action.

self.view.removeFromSuperview()
self.removeFromParentViewController()
Rohit Parihar
  • 352
  • 1
  • 7
  • 14