that is my code to present lookup
let vc = self.storyboard?.instantiateViewController(withIdentifier: "EmployeeLookUpVC") as! EmployeeLookUpVC
self.present(vc, animated: true, completion: nil)
that is my code to present lookup
let vc = self.storyboard?.instantiateViewController(withIdentifier: "EmployeeLookUpVC") as! EmployeeLookUpVC
self.present(vc, animated: true, completion: nil)
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()