Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. class ParentVC: UIViewController {
  2. override func viewDidLoad() {
  3. NotificationCenter.default.addObserver(self,
  4. selector: #selector(ParentVC.handleModalDismissed),
  5. name: NSNotification.Name(rawValue: "modalIsDimissed"),
  6. object: nil)
  7. }
  8.  
  9. func handleModalDismissed() {
  10. // Do something
  11. }
  12. }
  13.  
  14. class ModalVC: UIViewController {
  15. func someFunc() {
  16. dismiss(animated: true) {
  17. NotificationCenter.default.post(name: NSNotification.Name(rawValue: "modalIsDimissed"), object: nil)
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement