Created
November 10, 2017 16:30
-
-
Save yabenatti/6442cc4ffcd2e562d1fe1f2a1f9387ed to your computer and use it in GitHub Desktop.
DelegateTutorialSecondViewController
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
import UIKit | |
protocol SecondViewControllerProtocol { | |
func didDoSomethingOnSecondViewController(message: String) | |
} | |
class SecondViewController: UIViewController { | |
//MARK: - Variables | |
var delegate: SecondViewControllerProtocol? | |
//MARK: - IBActions | |
@IBAction func didTapCTAButton(_ sender: Any) { | |
self.navigationController?.popViewController(animated: true) | |
self.delegate?.didDoSomethingOnSecondViewController(message: "Sending message back to FirstViewController") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment