Created
February 6, 2020 06:57
-
-
Save wotjd/57ad6b848c0b8d749d6e11ec7377fa9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParentViewController: UIViewController { | |
let button: UIButton() | |
... | |
func onTapButton() { | |
let popupVC = PopupViewController() | |
popupVC.onDoneBlock = { [weak self] in | |
self?.moveToNextView() | |
} | |
} | |
func moveToNextView() { | |
... | |
} | |
} | |
class PopupViewController: UIViewController { | |
let closeButton: UIButton() | |
var onDoneBlock: (() -> Void)? = nil | |
func onTapButton() { | |
self.dismiss(true, completion: self.onDoneBlock) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment