Skip to content

Instantly share code, notes, and snippets.

@Ceri-anne
Created November 25, 2017 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ceri-anne/83db251c9b6a7dc5423bdb854615932d to your computer and use it in GitHub Desktop.
Save Ceri-anne/83db251c9b6a7dc5423bdb854615932d to your computer and use it in GitHub Desktop.
ViewController
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