Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
  2.  
  3. dataObj = frc.object(at: indexPath) as! Data_Object
  4. var pvc: UIViewController?
  5.  
  6. if dataObj.type == "X" {
  7.  
  8. let obj = MainStoryboard().instantiateViewController(withIdentifier: "XVC") as! XVC
  9. obj.data = dataObj
  10. obj.isFull = true
  11. obj.delegate = self
  12. pvc = obj as UIViewController
  13.  
  14. } else if dataObj.type == "Y" {
  15.  
  16. let obj = MainStoryboard().instantiateViewController(withIdentifier: "YVC") as! YVC
  17. obj.data = dataObj
  18. obj.isFull = true
  19. obj.delegate = self
  20. pvc = obj as UIViewController
  21.  
  22. } else {
  23.  
  24. let obj = MainStoryboard().instantiateViewController(withIdentifier: "ZVC") as! ZVC
  25. obj.data = dataObj
  26. obj.isFull = true
  27. obj.delegate = self
  28. pvc = obj as UIViewController
  29. }
  30.  
  31. obj.modalPresentationStyle = .popover
  32. let popPVC = pvc?.popoverPresentationController
  33. popPVC?.sourceView = self.view
  34. self.present(pvc!, animated: true, completion: nil)
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement