Created
February 9, 2018 14:06
-
-
Save DonMag/83bdfae39a36ef2bbbb6d424a36090f3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // | |
| // MyAlertFunc.swift | |
| // temp | |
| // | |
| // Created by Don Mag on 2/9/18. | |
| // | |
| import UIKit | |
| func myAlertFunc(_ thePresenter: UIViewController, theString: String) -> Void { | |
| let alert = UIAlertController(title: "From MyAlertFunc.swift", message: theString, preferredStyle: .alert) | |
| let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil) | |
| alert.addAction(defaultAction) | |
| thePresenter.present(alert, animated: true, completion: nil) | |
| } |
This file contains hidden or 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 MyViewController: UIViewController { | |
| @IBAction func didTap(_ sender: Any) { | |
| myAlertFunc(self, theString: "This is a test") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment