Created
November 25, 2017 20:20
-
-
Save Ceri-anne/83db251c9b6a7dc5423bdb854615932d to your computer and use it in GitHub Desktop.
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