ViewController
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 | |
class ViewController: UIViewController { | |
@IBAction func buttonTapped(_ sender: Any) { | |
performSegue(withIdentifier: "showWebView", sender: sender) | |
} | |
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | |
if let button = sender as? UIButton, let destination = segue.destination as? WebViewController { | |
destination.colour = button.titleLabel?.text | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment