title: Delegate Pattern In Swift w/o Segue
body: <p>I cannot find an example of the Swift Delegate pattern without the segue included. I want the boss class(boss view) to send orders to the worker class(worker view) and print what the boss says to print. The Delegate is coming up 'nil' when I press either of the buttons (doThisButton/doThatButton) on the boss page.  </p>
  
  <p><strong>Edit: My Views are set up as follows: the 'TheBoss' VC has three buttons, 'doThisButton', 'doThatButton', and 'goToTheWorker' button. the 'TheWorker' VC has a text box. The 'doThisButton'/'doThatButton' send information to the text box in 'TheWorker' VC, but do not make 'TheWorker' VC appear. the 'goToTheWorker' button is a show segue that was set up in storyboard to open the 'TheWorker' VC.</strong></p>
  
  <p>This is the 'Boss' class</p>
  
  <pre><code>import UIKit
  
  protocol TheBossesOrdersDelegate {
      func doThis(numberOne: Int, stringOne: String)
      func doThat(numberTwo: Int, stringTwo: String)
  }
  
  class TheBoss: UIViewController {
  
      // Declair Delegate
      var delegate: TheBossesOrdersDelegate!
  
      @IBAction func doThisButton(_ sender: UIButton) {
          delegate.doThis(numberOne: 75, stringOne: "Do This")
      }
      @IBAction func doThatButton(_ sender: UIButton) {
          delegate.doThat(numberTwo: 125, stringTwo: "Do That")
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  }
  </code></pre>
  
  <p>This is the 'Worker' class</p>
  
  <pre><code>import UIKit
  
  class TheWorker: UIViewController, TheBossesOrdersDelegate {
  
      let theBoss = TheBoss()
  
      func doThis(numberOne: Int, stringOne: String) {
          print("the boss send this number to print: \(numberOne) and this string: \(stringOne)")
          theWorkersTextBox.text = "Number: \(numberOne) String:\(stringOne)"
      }
  
      func doThat(numberTwo: Int, stringTwo: String) {
          print("the boss send this number to print: \(numberTwo) and this string: \(stringTwo)")
          theWorkersTextBox.text = "Number: \(numberTwo) String:\(stringTwo)"
      }
  
      @IBOutlet weak var theWorkersTextBox: UITextField!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          theBoss.delegate = self
      }
  }
  </code></pre>