title: accessing variables from view controller to the override function
body: <p>I am making an app that selects a random  question from my array every time I shake my phone. As shown below; I tried to call the "print" function in the "override function motionBegan" but it didn't work. Can anyone help.?</p>
  
  <pre><code>override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
  
          let array  = ["what did your eat for breakfast?", "First time you kissed a boy/girl? Explain.", "Whats your body count?", "When was the last time you went to church?", "Would you date someone from another religion?", "East booty(Guy) ?or let a guy eat your booty(Girl)?", "If you die right now where will you end?", "whats on your mind?", "Ever has a one night stand?", "Do you find the other person attractive?", "How old where you when you first hd sex?. Explain.", "You believe in Jesus?", "Where do you see yourself in 10 years?", "First time you gave head?", "Slap your mum or your dad? Choose one.", "Last time you watched porn?", "How much is in your account?", "One thing you hate about the other person?", "One thing you love about the other person?", "Would you kiss the person close to you?", "One thing you hate about yourself?", " One thing you love about yourself?","Suck toes or eat booty?", "Best rapper?", "Best singer?", "If you had a billion dollars for 24 hours how will you spend it?"]
  
              let randomIndex = Int(arc4random_uniform(UInt32(array.count)))
              // Get a random item
              let  randomItem = array[randomIndex]
  
          func print() {
              textField.text = randomItem
          }
      }
  
      override func motionBegan(_ motion: UIEventSubtype, with event: UIEvent?) {
          print;
  
      }
  </code></pre>