Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- dataObj = frc.object(at: indexPath) as! Data_Object
- var pvc: UIViewController?
- if dataObj.type == "X" {
- let obj = MainStoryboard().instantiateViewController(withIdentifier: "XVC") as! XVC
- obj.data = dataObj
- obj.isFull = true
- obj.delegate = self
- pvc = obj as UIViewController
- } else if dataObj.type == "Y" {
- let obj = MainStoryboard().instantiateViewController(withIdentifier: "YVC") as! YVC
- obj.data = dataObj
- obj.isFull = true
- obj.delegate = self
- pvc = obj as UIViewController
- } else {
- let obj = MainStoryboard().instantiateViewController(withIdentifier: "ZVC") as! ZVC
- obj.data = dataObj
- obj.isFull = true
- obj.delegate = self
- pvc = obj as UIViewController
- }
- obj.modalPresentationStyle = .popover
- let popPVC = pvc?.popoverPresentationController
- popPVC?.sourceView = self.view
- self.present(pvc!, animated: true, completion: nil)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement