Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ParentVC: UIViewController {
- override func viewDidLoad() {
- NotificationCenter.default.addObserver(self,
- selector: #selector(ParentVC.handleModalDismissed),
- name: NSNotification.Name(rawValue: "modalIsDimissed"),
- object: nil)
- }
- func handleModalDismissed() {
- // Do something
- }
- }
- class ModalVC: UIViewController {
- func someFunc() {
- dismiss(animated: true) {
- NotificationCenter.default.post(name: NSNotification.Name(rawValue: "modalIsDimissed"), object: nil)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement